execute pg_dump via python

From: Garry Saddington <garry(at)schoolteachers(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: execute pg_dump via python
Date: 2007-10-25 11:11:59
Message-ID: 200710251211.59905.garry@schoolteachers.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using zope on windows with an external python method to backup my
database. I am struggling to run the following command:

pg_dump.exe database > file

I have tried using os.popen - no luck
and also subprocess.Popen.

eg:
import subprocess

subprocess.Popen(['c:/dir/dir/pg_dump.exe','database','>','c:/dir/dir/output
file'])

The command string works perfectly in a terminal. Does anyone know how I
should be doing this? I get no errors or traceback when I try the method
through Zope.

regards
garry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Childs 2007-10-25 11:15:14 Re: conditional alter table add ?
Previous Message tfinneid 2007-10-25 11:07:55 Re: select count() out of memory