Re: running pg_dump from python - Mailing list pgsql-general

From Jasen Betts
Subject Re: running pg_dump from python
Date
Msg-id h15e47$tu7$3@reversiblemaps.ath.cx
Whole thread Raw
In response to running pg_dump from python  (Garry Saddington <garry@schoolteachers.co.uk>)
Responses Re: running pg_dump from python
List pgsql-general
On 2009-06-14, Garry Saddington <garry@schoolteachers.co.uk> wrote:
> 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")

are you sure you're using os.popen correctly?
you don't appear to be waiting for the pg_dump process to finish.


>     data=open('c:/scholarpack/ancillary/scholarpack.sql','r')
>     r=data.read()
>     data.close
>     return r
>


pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: cygwin and postgresql
Next
From: Artur
Date:
Subject: 10 TB database