Re: JSON validation behavior

Поиск
Список
Период
Сортировка
От Sergei Kornilov
Тема Re: JSON validation behavior
Дата
Msg-id 160951540393781@myt1-8f46c049cd43.qloud-c.yandex.net
обсуждение исходный текст
Ответ на Re: JSON validation behavior  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Hi

24.10.2018, 17:40, "David G. Johnston" <david.g.johnston@gmail.com>:
> On Wed, Oct 24, 2018 at 7:25 AM Sergei Kornilov <sk@zsrv.org> wrote:
>
>> DETAIL:  \u0000 cannot be converted to text.
>>
>> Well, requested text type can not have \u0000 byte. But seems strange: we test json type with this value but raise
sameerror for -> operator:
 
>>
>> We allow write such json to table, we allow read whole json, but we can not use native operators. Is this behavior
expected?
>
> It isn't that different than saying:
>
> '123bcd'::integer -- error, invalid input for type integer
>
> While text can hold just about everything it cannot contain an actual ASCII NUL character and so a JSON value with a
unicoderepresented NUL cannot be converted to text.  Text doesn't have a stored concept of escaped values, using escape
isonly valid during entry.
 
Yes, it is reasonable for operators which returns text, such as ->>  (and i do not have question on this)
I was surprised by operators with json type result

regards, Sergei


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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: pgbench - add pseudo-random permutation function
Следующее
От: Sandeep Thakkar
Дата:
Сообщение: Re: Problem with EDB 11.0 Windows x64 distributions