Passing variable to SQL statement when using psycopg2

Gregory Ewing greg.ewing at
Mon Aug 30 10:22:21 CEST 2010

Chris Rebert wrote:
> On Sun, Aug 29, 2010 at 11:29 PM, Julia Jacobson

>>Where does the "E" in front of 'xyz' come from?
>>It's probably the reason, why my query doesn't work.
> Quite doubtful, considering the example in the psycopg2 docs also has the E:

Seems to be a postgres extension to the sql string literal syntax:


More information about the Python-list mailing list