Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: PQescapeByteaConn - returns wrong string for PG9.1 Beta3
Дата
Msg-id 806A04FD-FF77-45F6-A556-77D94A3D8423@phlo.org
обсуждение исходный текст
Ответ на PQescapeByteaConn - returns wrong string for PG9.1 Beta3  ("Petro Meier" <Petro85@gmx.de>)
Список pgsql-hackers
On Jul27, 2011, at 08:51 , Petro Meier wrote:
> If  I use PQescapeByteaConn() for a conenction to a PG9.1 Beta3 server, this function returns (e.g.)
"\xea2abd8ef31...(andso on.)...". 
> Here the problem: there should be a second backslash in the prefix. The SQL Statement which uses this string (INSERT
statementin my case) returns with an error ("Invalid byte sequence..."). If I add the second backslash manually
everythingworks fine. 
> When connecting to a PG9.0 server and using this function, the return value is correct (with two backslashes):
"\\xea2abd8ef31...(and so on.)...". 
> This should be a bug in PG9.1 Beta3

Sounds as if PQescapeByteaConn() is confused about whether standard_conforming_strings is on or off. What value does
thatsetting have in your 9.0 and 9.1 instances? 

BTW, I think 9.1 is the first release where that settings defaults to "on", so maybe that adds to PQescapeByteaConn()'s
confusion.In theory it shouldn't since PQescapeByteaConn() should simply detect the server's setting and react
accordingly,but who knows... 

best regards,
Florian Pflug



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

Предыдущее
От: "Petro Meier"
Дата:
Сообщение: PQescapeByteaConn - returns wrong string for PG9.1 Beta3
Следующее
От: Noah Misch
Дата:
Сообщение: Re: sinval synchronization considered harmful