passing multiple records to json_populate_recordset

Поиск
Список
Период
Сортировка
От Raphael Bauduin
Тема passing multiple records to json_populate_recordset
Дата
Msg-id CAONrwUFbuBBUCm+jNNpU7LQ1SV-5O4SWWpX8fFq6ujBcRvwN8w@mail.gmail.com
обсуждение исходный текст
Ответы Re: passing multiple records to json_populate_recordset  (Raphael Bauduin <rblists@gmail.com>)
Список pgsql-general
Hi,

I'm experimenting with the json data type and functions in 9.3.
I'm storing json objects of this form in the event column:
{type: 'event_type, products : [ {id:45, 'type': 3, 'gender':'F',..}, ..., {....} ] }

I can issue this query, but notice the limit 1:

select * from json_populate_recordset(null::product, (select  event->'products' from events limit 1));

The result is:

 type | gender |  id  
------+--------+-------
   41 | F      | 40003
   41 | F      | 60043
   41 | F      | 27363
   41 | F      | 27373
   41 | F      | 28563

But all these products come from one event.
Is there a way to return the products from several events?, eg with a limit 2 rather than limit 1?

Thanks

Raph

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

Предыдущее
От: Kaare Rasmussen
Дата:
Сообщение: Re: Tree structure
Следующее
От: Rémi Cura
Дата:
Сообщение: Re: Tree structure