Re: invalidly encoded strings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: invalidly encoded strings
Дата
Msg-id 16632.1189396986@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: invalidly encoded strings  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: invalidly encoded strings  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> If it's done in the scanner it should still accept things like:
>   E'\\377\\000\\377'::bytea
> right? 

Right, that will work, because the transformed literal is '\377\000\377'
(no strange characters there, just what it says) and that has not got
any encoding violations.

> I think the concern is when they use only one slash, like:
>   E'\377\000\377'::bytea
> which, as I mentioned before, is not correct anyway.

Note also that if you have standard_conforming_strings set to ON,
this gives the very same result:
  '\377\000\377'::bytea

I'm not convinced that we need to move heaven and earth to make this
work the same with or without E''.  Basically what I'm thinking is we
should just decree that the de-escaped string literal still has to be
valid per the database encoding.  If you don't want to be bound by that,
use the right number of backslashes to get the thing passed through to
the bytea input routine.
        regards, tom lane


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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: invalidly encoded strings
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: invalidly encoded strings