Search Postgresql Archives

running pg_dump from python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux