Re: returning json data row from json query

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: returning json data row from json query
Дата
Msg-id 1388821492145-5785303.post@n5.nabble.com
обсуждение исходный текст
Ответ на returning json data row from json query  ("john.tiger" <john.tigernassau@gmail.com>)
Ответы Re: returning json data row from json query
Список pgsql-general
john.tiger wrote
> select * from users where jsondata->>'username' = 'jdoe' works but
> returns field names, etc besides the data row.    how can we get json
> data back ?
>
> select row_to_json from users where jsondata->>'username'='jdoe' didn't
> work.
>
> any ideas ? thks.

Using what client?  There is no way, using SQL, to get a non-table output;
but your client might give you ways to ignore or suppress the column name.

And row_to_json is a function, you have to pass argument(s) to it to use it.
There is documentation explaining how to do so and what the end result will
look like.

David J.







--
View this message in context:
http://postgresql.1045698.n5.nabble.com/returning-json-data-row-from-json-query-tp5785293p5785303.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Jayadevan M
Дата:
Сообщение: Re: authentication failure
Следующее
От: "Yngve N. Pettersen"
Дата:
Сообщение: Possible multiprocess lock/unlock-loop problem in Postgresql 9.2