Re: Unpacking scalar JSON values - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Unpacking scalar JSON values
Date
Msg-id 521A11FE.7000300@dunslane.net
Whole thread Raw
In response to Re: Unpacking scalar JSON values  (Daniel Farina <daniel@fdr.io>)
List pgsql-hackers
On 08/24/2013 09:08 PM, Daniel Farina wrote:
> On Sat, Aug 24, 2013 at 6:04 PM, Daniel Farina <daniel@fdr.io> wrote:
>> But there's no good way I can find from the documentation to do it
>> with a scalar: select ('"va\"lue"'::json)::text;
> Triggered send by accident:
>
> select ('"va\"lue"'::json)::text;
>     text
> -----------
>   "va\"lue"
> (1 row)
>
> the JSON escaping is retained.  That may be reasonable for a
> text-cast, so I'm not suggesting its reinterpretation, but there is no
> operator I can identify immediately from the documentation to convert
> a JSON string value into a Postgres one like json_each_text, except on
> a json that contains a scalar JSON string.
>
>


This came up recently on -bugs. See 
<http://www.postgresql.org/message-id/51FBF787.5000408@dunslane.net>, 
where I suggested we expose the dequoting function.

cheers

andrew



pgsql-hackers by date:

Previous
From: Marc Cousin
Date:
Subject: Re: Performance problem in PLPgSQL
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: lob conversion functionality