Copy database with python..

Martin Sand Christensen msc at es.aau.dk
Fri Nov 2 10:11:06 EDT 2007


>>>>> "Abandoned" == Abandoned  <besturk at gmail.com> writes:
Abandoned> I want to copy my database but python give me error when i
Abandoned> use this command. cursor.execute("pg_dump mydata > old.dump")
Abandoned> What is the problem ?

cursor.execute() is for executing SQL commands, and this is not an SQL
command, but rather a shell command.

Abandoned> And how can i copy the database with python ? Note: The
Abandoned> database's size is 200 GB

If you want to do this from Python, run it as a separate process.

Martin



More information about the Python-list mailing list