Re: strange characters

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: strange characters
Дата
Msg-id 201101100647.07021.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на strange characters  ("Manera, Villiam" <vmanera@manord.com>)
Ответы R: strange characters  ("Manera, Villiam" <vmanera@manord.com>)
Список psycopg
On Monday 10 January 2011 6:32:24 am Manera, Villiam wrote:
> I try the example in the manual:
>
> SQL = "INSERT INTO authors (name) VALUES (%s);"
>
> data = ("O'Reilly", )
>
> cur.mogrify(SQL,data)
>
> "INSERT INTO authors (name) VALUES (E'O''Reilly');"
>
> strange characters:
>
> àE'ß
>
> The same in
>
> >>> cur.mogrify("select * from xxx where coll='%(coll)s'",{'coll':'1'});
>
> "select * from xxx where coll='E'1''"
>
> Instead with number work fine:
> >>> cur.mogrify("select * from xxx where coll='%(coll)s'",{'coll':1});
>
> "select * from xxx where coll='1'"
>
>
>
> Environment:
>
> Server: PostgreSQL 9.0.1 on x86_64-unknown-linux-gnu, compiled by GCC gcc
> (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48), 64-bit
>
> psycopg2-2.3.1
>
>
>
> Villiam

If you are referring to the 'E' it is not strange. That is the new Postgres
escape identifier. The backslash escape is being phased out.

--
Adrian Klaver
adrian.klaver@gmail.com

В списке psycopg по дате отправления:

Предыдущее
От: "Manera, Villiam"
Дата:
Сообщение: strange characters
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: strange characters