Re: Getting the queried result in the form of json structure

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Getting the queried result in the form of json structure
Дата
Msg-id 6304d291-ec07-2519-9430-f0919b2d254b@aklaver.com
обсуждение исходный текст
Ответ на Re: Getting the queried result in the form of json structure  (msn <pioneer.suri@gmail.com>)
Список pgsql-sql
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



В списке pgsql-sql по дате отправления:

Предыдущее
От: msn
Дата:
Сообщение: Re: Getting the queried result in the form of json structure
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Getting the queried result in the form of json structure