returning json object with subset of keys

Поиск
Список
Период
Сортировка
От Raphael Bauduin
Тема returning json object with subset of keys
Дата
Msg-id CAONrwUGMQthsut_F8X4CBGQDuKa5=A+AtmxSXb2FdOXh5PD3Qg@mail.gmail.com
обсуждение исходный текст
Ответы Re: returning json object with subset of keys
Список pgsql-general
Hi

I'm using the json functionalities of postgresql 9.3.
I have a query calling json_populate_recordset like this:
  json_populate_recordset(null::product, event->'products')
but it returns an error:
ERROR:  cannot call json_populate_recordset on a nested object

There is indeed one key in event->'products' giving access to an array of objects.

Is there a way to specify which keys to keep from the object? I haven't found ti in the docs.

Here is pseudo code of what I'd like to do:
  json_populate_recordset(null::product, event->'products' WITH ONLY KEYS {'f1','f2'})

Thx 


--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org event->'products'

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

Предыдущее
От: Sameer Kumar
Дата:
Сообщение: Re: How to know server status variable in postgresql?
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: returning json object with subset of keys