Postgres COPY Command with python 2.3 pg

Michael Lang Michael.Lang at jackal-net.at
Tue Feb 15 12:54:43 EST 2005


Hi to all,

can some one point me to the correct way, how to use PostgreSQLs "COPY" feature
from within python ?

What i want to do is:

	connect
	 start transaction
 	  drop current tablecontens
          copy new content from STDIN  # file need more privileged user rights
	 commit transaction

using psql it works fine, but i dont know how to get it working in python.
Ive already made the calls but the changes never apper, and no error.
my suggestion was, that "db.query("input|input|input") doesnt work as STDIN for
the Database, and i tryed db.putline(....) but no success.

Kind regards for any help
Michael Lang




More information about the Python-list mailing list