Re: PQescapeBytea is not multibyte aware

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: PQescapeBytea is not multibyte aware
Дата
Msg-id 3CAE1CEB.9030401@joeconway.com
обсуждение исходный текст
Ответ на PQescapeBytea is not multibyte aware  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Ответы Re: PQescapeBytea is not multibyte aware  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> 
>>I think you're correct that in a client/database encoding mismatch 
>>scenario, there would be bigger problems. Thoughts on this?
> 
> 
> This scenario is probably why Tatsuo wants PQescapeBytea to octalize
> everything with the high bit set; I'm not sure there's any lesser way

Yuck! At that point you're no better off than converting to hex (and 
worse off than converting to base64) for storage.

SQL99 actually defines BLOB as a binary string literal comprised of an 
even number of hexadecimal digits, in single quotes, preceded by "X", 
e.g. X'1a43fe'. Should we be looking at implementing the standard 
instead of, or in addition to, octalizing? Maybe it is possible to do 
this by creating a new datatype, BLOB, which uses new IN/OUT functions, 
but otherwise uses the various bytea functions?


> out.  Nonetheless, if UNKNOWN conversion introduces additional failures
> then it makes sense to fix that.

I'll follow up on this then.

Joe




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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Suggestion for optimization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PQescapeBytea is not multibyte aware