Try opening your file, reading its contents and then having db.executesql() 
execute what was read. Should work assuming the file's contents can be run 
by psycopg2 (i.e some special psql stuff might not work)

#untested code
f = open('/path/to/file.sql', 'r')
db.executesql(f.read())

Reply via email to