Re: jsonb, unicode escapes and escaped backslashes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Noah Misch <noah(at)leadboat(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb, unicode escapes and escaped backslashes
Date: 2015-01-27 17:55:42
Message-ID: 54C7D11E.607@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 01/27/2015 12:23 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 01/27/2015 12:24 AM, Noah Misch wrote:
>>> +1 for splitting development that way. Fixing the use of escape_json() is
>>> objective, but the choices around the warning are more subtle.
>> OK, so something like this patch? I'm mildly concerned that you and I
>> are the only ones commenting on this.
> Doesn't seem to me like this fixes anything. If the content of a jsonb
> value is correct, the output will be the same with or without this patch;
> and if it's not, this isn't going to really improve matters.
>
> I think coding anything is premature until we decide how we're going to
> deal with the fundamental ambiguity.
>
>

The input \\uabcd will be stored correctly as \uabcd, but this will in
turn be rendered as \uabcd, whereas it should be rendered as \\uabcd.
That's what the patch fixes.

There are two problems here and this addresses one of them. The other
problem is the ambiguity regarding \\u0000 and \u0000.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Nenciarini 2015-01-27 18:04:21 File based Incremental backup v7
Previous Message Marco Nenciarini 2015-01-27 17:41:01 Re: File based incremental backup v6