| From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
|---|---|
| To: | Federico Di Gregorio <fog(at)dndg(dot)it> |
| Cc: | psycopg(at)postgresql(dot)org, Brent Hoover <brent(at)thebuddhalodge(dot)com> |
| Subject: | Re: Passing in parameters enclosed in double quotes |
| Date: | 2011-11-18 17:22:41 |
| Message-ID: | 201111180922.41812.adrian.klaver@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(dot)klaver(at)gmail(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniele Varrazzo | 2011-11-18 21:34:16 | Re: RFC: Extend psycopg2.connect to accept all valid parameters? |
| Previous Message | Federico Di Gregorio | 2011-11-18 16:58:10 | Re: Passing in parameters enclosed in double quotes |