Re: Unpacking scalar JSON values

From: Daniel Farina <daniel(at)fdr(dot)io>
To: Hannu Krosing <hannu(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unpacking scalar JSON values
Date: 2013-08-25 01:08:14
Message-ID: CACN56+MaepqypFyLJ+Fwjio-Sy-mz0rjgtbMRSawSfj6ixqmaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 24, 2013 at 6:04 PM, Daniel Farina <daniel(at)fdr(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kanarupan Kularatnarajah 2013-08-25 02:06:12 bitset counting as a user defined function in postgresql 9.2?
Previous Message Daniel Farina 2013-08-25 01:04:40 Re: Unpacking scalar JSON values