On 04/29/2016 02:40 AM, msn wrote:
> Could any body please tell me, Is my requirement possible? It would be
> appreciated if i get the response, because It is completely blocking my
> task.
Did you try Hectors suggestion:
"cast it
select info::text from sample;"
test=# select info::text from sample; info
------------------------------------------------------------------------------------------------------------------
{"person":{"age": 25, "name": {"lastname": "bob", "firstname":
"Alice"}, "empId": "E067", "phone": 9804484234}}
If that is not what you want there are a whole slew of functions that
allow you to manipulate the data:
http://www.postgresql.org/docs/9.5/interactive/functions-json.html
*NOTE* the above is from Postgres 9.5, not all of them may be available
in earlier version.
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/Getting-the-queried-result-in-the-form-of-json-structure-tp5900554p5901157.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com