Re: Making TEXT NUL-transparent

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: Making TEXT NUL-transparent
Дата
Msg-id 82d3chswdk.fsf@mid.bfk.de
обсуждение исходный текст
Ответ на Re: Making TEXT NUL-transparent  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Making TEXT NUL-transparent  (Alexander Shulgin <ash@commandprompt.com>)
Re: Making TEXT NUL-transparent  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
* Pavel Stehule:

> Hello
>
> 2011/11/24 Florian Weimer <fweimer@bfk.de>:
>> Occasionally, we get bitten by embedded NUL bytes in TEXT values.  We
>> take care of generating proper UTF-8, but this additional restriction
>> sometimes slips by.  It would be really helpful if PostgreSQL could
>> store such TEXT fields as-is (at least if they are computed internally,
>> or come from query parameters).
>>
>
> and why you don't use bytea ? Text should be correct literal.

It's actually UTF-8 text, and some PostgreSQL functions are only
available for TEXT, but not BYTEA, e.g.:

bfk_int=> SELECT '\x006500'::bytea ~ 'A';
ERROR:  operator does not exist: bytea ~ unknown
LINE 1: SELECT '\x006500'::bytea ~ 'A';                                ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


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

Предыдущее
От: Boszormenyi Zoltan
Дата:
Сообщение: Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64
Следующее
От: Alexander Shulgin
Дата:
Сообщение: Re: Making TEXT NUL-transparent