Re: Passing in parameters enclosed in double quotes

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Passing in parameters enclosed in double quotes
Дата
Msg-id 201111180922.41812.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на Re: Passing in parameters enclosed in double quotes  (Federico Di Gregorio <fog@dndg.it>)
Список 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 по дате отправления:

Предыдущее
От: Federico Di Gregorio
Дата:
Сообщение: Re: Passing in parameters enclosed in double quotes
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: RFC: Extend psycopg2.connect to accept all valid parameters?