On Fri, 2007-11-02 at 06:51 -0700, Abandoned wrote:
> Hi.
> I want to copy my database but python give me error when i use this
> command.
> cursor.execute("pg_dump mydata > old.dump")

cursor.execute executes SQL queries. pg_dump is not an SQL query, it is
an operating system command. To execute OS commands, use
os.system("...") or the subprocess module.

Hope this helps,

-- 
Carsten Haese
http://informixdb.sourceforge.net


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to