Re: Passing in parameters enclosed in double quotes - Mailing list psycopg

From Adrian Klaver
Subject Re: Passing in parameters enclosed in double quotes
Date
Msg-id 201111180922.41812.adrian.klaver@gmail.com
Whole thread Raw
In response to Re: Passing in parameters enclosed in double quotes  (Federico Di Gregorio <fog@dndg.it>)
List psycopg
On Friday, November 18, 2011 8:58:10 am Federico Di Gregorio wrote:

> > The only way I could get the substitution to work is:
> > cur.execute("""select pg_get_serial_sequence(%s,%s)""",('"test 1"','id'))
> > rs=cur.fetchall()
> > rs
> >
> >  [('public."test 1_id_seq"',)]
>
> Given your example query in psql that's correct.

It is only an issue if you actually need to double quote a table name to
preserve case, a space, a key word, etc.

--
Adrian Klaver
adrian.klaver@gmail.com

psycopg by date:

Previous
From: Federico Di Gregorio
Date:
Subject: Re: Passing in parameters enclosed in double quotes
Next
From: Daniele Varrazzo
Date:
Subject: Re: RFC: Extend psycopg2.connect to accept all valid parameters?