execute pg_dump via python

Поиск
Список
Период
Сортировка
От Garry Saddington
Тема execute pg_dump via python
Дата
Msg-id 200710251211.59905.garry@schoolteachers.co.uk
обсуждение исходный текст
Ответы Re: execute pg_dump via python  ("Trevor Talbot" <quension@gmail.com>)
Re: execute pg_dump via python  (Andy <nospam@noplace.com>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: tfinneid@student.matnat.uio.no
Дата:
Сообщение: Re: select count() out of memory
Следующее
От: "Peter Childs"
Дата:
Сообщение: Re: conditional alter table add ?