json/jsonb inconsistence

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема json/jsonb inconsistence
Дата
Msg-id 53872043.8000506@sigaev.ru
обсуждение исходный текст
Ответы Re: json/jsonb inconsistence  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
# select  '"\uaBcD"'::json;   json
---------- "\uaBcD"

but

# select  '"\uaBcD"'::jsonb;
ERROR:  invalid input syntax for type json
LINE 1: select  '"\uaBcD"'::jsonb;                ^
DETAIL:  Unicode escape values cannot be used for code point values above 007F 
when the server encoding is not UTF8.
CONTEXT:  JSON data, line 1: ...

and

# select  '"\uaBcD"'::json -> 0;
ERROR:  invalid input syntax for type json
DETAIL:  Unicode escape values cannot be used for code point values above 007F 
when the server encoding is not UTF8.
CONTEXT:  JSON data, line 1: ...
Time: 0,696 ms

More than, json looks strange:

# select  '["\uaBcD"]'::json;    json
------------ ["\uaBcD"]

but

# select  '["\uaBcD"]'::json->0;
ERROR:  invalid input syntax for type json
DETAIL:  Unicode escape values cannot be used for code point values above 007F 
when the server encoding is not UTF8.
CONTEXT:  JSON data, line 1: [...

Looks like random parse rules.

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



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

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: Proposing pg_hibernate
Следующее
От: Teodor Sigaev
Дата:
Сообщение: json/jsonb inconsistence - 2