Re: BUG #13533: jsonb_populate_record does not work when the value is a simple string - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13533: jsonb_populate_record does not work when the value is a simple string
Date
Msg-id 20357.1438733974@sss.pgh.pa.us
Whole thread Raw
In response to BUG #13533: jsonb_populate_record does not work when the value is a simple string  (paulovieira@gmail.com)
Responses Re: BUG #13533: jsonb_populate_record does not work when the value is a simple string  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
Paulo Vieira <paulovieira@gmail.com> writes:
> On Mon, Aug 3, 2015 at 5:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> This does not seem like a bug, because the value of the data field is
>> just abc, and that isn't JSON.  You'd need something more like
>>
>> input_data json := '{"id": 1, "data": "\"abc\""}';

> I'm confused. In my example the value is <double quotes>abc<double quotes>,
> which is a valid json value (and not simply abc).

No, the value of the field is just abc --- the quotes are JSON syntax
decoration, they are not part of the represented value.  If we do it
as you seem to have in mind, it would be impossible to deal sanely
with data values that contain quotes or backslashes.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13530: sort receives "unexpected out-of-memory situation during sort"
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #13533: jsonb_populate_record does not work when the value is a simple string