Re: [HACKERS] json/jsonb inconsistence - 2

2014-05-29 Thread Teodor Sigaev
Actually, this is just the tip of the iceberg. Funny, but postgres=# select '\u'::text; text \u (1 row) postgres=# select array['\u']::text[]; array - {"\\u"} postgres=# select '{"\u"}'::text[]; text - {u} postgres=# select '{"\

Re: [HACKERS] json/jsonb inconsistence - 2

2014-05-29 Thread Andrew Dunstan
On 05/29/2014 08:15 AM, Andrew Dunstan wrote: On 05/29/2014 08:00 AM, Teodor Sigaev wrote: postgres=# select '["\u"]'::json->0; ?column? -- "\u" (1 row) Time: 1,294 ms postgres=# select '["\u"]'::jsonb->0; ?column? --- "\\u" (1 row) It seems to me that es

Re: [HACKERS] json/jsonb inconsistence - 2

2014-05-29 Thread Andrew Dunstan
On 05/29/2014 08:00 AM, Teodor Sigaev wrote: postgres=# select '["\u"]'::json->0; ?column? -- "\u" (1 row) Time: 1,294 ms postgres=# select '["\u"]'::jsonb->0; ?column? --- "\\u" (1 row) It seems to me that escape_json() is wrongly used in jsonb_put_escap

[HACKERS] json/jsonb inconsistence - 2

2014-05-29 Thread Teodor Sigaev
postgres=# select '["\u"]'::json->0; ?column? -- "\u" (1 row) Time: 1,294 ms postgres=# select '["\u"]'::jsonb->0; ?column? --- "\\u" (1 row) It seems to me that escape_json() is wrongly used in jsonb_put_escaped_value(), right name of escape_json() is a es