Re: running pg_dump from python

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: running pg_dump from python
Date: 2009-06-15 12:17:11
Message-ID: h15e47$tu7$3@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-06-14, Garry Saddington <garry(at)schoolteachers(dot)co(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-06-15 12:29:48 Re: 10 TB database
Previous Message Jasen Betts 2009-06-15 12:08:22 Re: cygwin and postgresql