On Nov 2, 4:11 pm, Martin Sand Christensen <[EMAIL PROTECTED]> wrote: > >>>>> "Abandoned" == Abandoned <[EMAIL PROTECTED]> 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 Yes i understand thank you. Now i find that maybe help the other users.
import os os.system("su postgres") ... .. -- http://mail.python.org/mailman/listinfo/python-list