running pg_dump from python

Поиск
Список
Период
Сортировка
От Garry Saddington
Тема running pg_dump from python
Дата
Msg-id 4A355860.1010102@schoolteachers.co.uk
обсуждение исходный текст
Ответы Re: running pg_dump from python  (Scott Mead <scott.lists@enterprisedb.com>)
Список pgsql-general
I ahve the following python file that I am running as an external method
in Zope.

def backup():
    import  os
    os.popen("c:/scholarpack/postgres/bin/pg_dump scholarpack  >
c:/scholarpack/ancillary/scholarpack.sql")
    data=open('c:/scholarpack/ancillary/scholarpack.sql','r')
    r=data.read()
    data.close
    return r

However, when I run this script it creates the file scholarpack.sql but
the file is empty.
Any help much appreciated.
Regards
Garry

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

Предыдущее
От: "James B. Byrne"
Дата:
Сообщение: Re: cygwin and postgresql
Следующее
От: Scott Mead
Дата:
Сообщение: Re: running pg_dump from python