Re: json/jsonb inconsistence - 2 - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: json/jsonb inconsistence - 2
Date
Msg-id 538724E8.2040009@dunslane.net
Whole thread Raw
In response to json/jsonb inconsistence - 2  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: json/jsonb inconsistence - 2  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 05/29/2014 08:00 AM, Teodor Sigaev wrote:
> postgres=# select  '["\u0000"]'::json->0;
>  ?column?
> ----------
>  "\u0000"
> (1 row)
>
> Time: 1,294 ms
> postgres=# select  '["\u0000"]'::jsonb->0;
>  ?column?
> -----------
>  "\\u0000"
> (1 row)
>
> It seems to me that escape_json() is wrongly used in 
> jsonb_put_escaped_value(), right name of escape_json() is a 
> escape_to_json().


That's a bug. I will look into it. I think we might need to special-case 
\u0000 on output, just as we do on input.

cheers

andrew




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Replacement for OSSP-UUID for Linux and BSD
Next
From: Teodor Sigaev
Date:
Subject: Re: json/jsonb inconsistence