Robert Bernier schrieb:
> I'm getting an error message that says:
>
> NameError: name 'escape_bytea' is not defined
>
> Here's the example code I used:
>
> import pg
> conn =
> pg.connect(dbname="postgres",host="localhost",user="user",passwd="mypassword")
> conn.query("create table temp(x bytea)
> mybin = file('PyGreSQL.tgz','rb').read()
> conn.query("insert into temp values('%s')"%escape_bytea(mybin))
You need to either
from pg import escape_bytea
or write pg.escape_bytea(...)
-- Chris
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql