Re: revert function for to_json ? - Mailing list pgsql-general

From Marc Mamin
Subject Re: revert function for to_json ?
Date
Msg-id B6F6FD62F2624C4C9916AC0175D56D8842154FD9@jenmbs01.ad.intershop.net
Whole thread Raw
In response to revert function for to_json ?  (Marc Mamin <M.Mamin@intershop.de>)
List pgsql-general
>From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Marc Mamin
>Sent: Montag, 23. Mai 2016 16:03
>To: pgsql-general@postgresql.org
>Subject: [GENERAL] revert function for to_json ?
>
>Hello,
>
>I'm looking for $subject
>
>example:
>
>how to revert
>  select to_json(E'a\n''b'::text)
>
>I can achieve it with something like this:
>  select json_extract_path_text(('{"a":'||to_json(E'a\n''b'::text)||'}')::json,'a')
>
>does anybody knows a  less ugly solution ?

I just  found the solution here:
http://stackoverflow.com/questions/27215216/postgres-how-to-convert-json-string-to-text

:-)

select to_json(E'a\n''b'::text)#>>'{}'



>
>regards,
>
>Marc Mamin
>


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: postgresql embedded mode
Next
From: Bruno Wolff III
Date:
Subject: Re: Postgresql-fdw