Re: PQescapeBytea* version for parameters

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: PQescapeBytea* version for parameters
Дата
Msg-id 87hcod8dgv.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: PQescapeBytea* version for parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <stark@enterprisedb.com> writes:
>> Do we want something like this which provides a PQescapeByteaParam for
>> escaping bytea strings before passing them as text-mode parameters in
>> PQexecParam?
>
> Seems a lot easier and more efficient to just pass out-of-line bytea
> parameters as binary mode.

Well that's definitely true. The case in hand was a PHP where the PHP driver
doesn't seem to automatically use binary mode and doesn't provide any way for
the application to select it either. 

It expects the user code to handle the escaping for all parameters using
PQEscape* functions. But there is no candidate function to handle bytea ascii
parameters. I'm sure it can be done in PHP directly though.

Incidentally it seems even using PQEscapeBytea with standard conforming
strings set is still corrupting the byteas so there may be an actual bug
somewhere. Haven't had a chance to look into it yet though.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: psql/pg_dump vs. dollar signs in identifiers
Следующее
От: "Florian G. Pflug"
Дата:
Сообщение: ReadRecord, EndRecPtr and XLOG_SWITCH