Re: jsonb, unicode escapes and escaped backslashes

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: jsonb, unicode escapes and escaped backslashes
Дата
Msg-id CA+TgmoYaHTe3AYy6+jaot2V0ebTs_gKbMMhVSLr1k9nhF7Tr6Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonb, unicode escapes and escaped backslashes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Jan 29, 2015 at 5:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> I have yet to understand what we fix by banning \u0000.  How is 0000
>> different from any other four-digit hexadecimal number that's not a
>> valid character in the current encoding?  What does banning that one
>> particular value do?
>
> BTW, as to the point about encoding violations: we *already* ban \uXXXX
> sequences that don't correspond to valid characters in the current
> encoding.  The attempt to exclude U+0000 from the set of banned characters
> was ill-advised, plain and simple.

Oh.  Well, that's hard to argue with, then.  I can't imagine why we'd
disallow all bytes invalid in the current encoding *except* for \0.
When I originally coded up the JSON data type, I intended for it to
store invalidly-encoded data that was nevertheless valid JSON without
trying to interpret it.  It seems we've drifted pretty far off of that
principle.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: jsonb, unicode escapes and escaped backslashes
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: jsonb, unicode escapes and escaped backslashes