Re: [GENERAL] Returning values from an array of JSONB objects.

2016-04-13 Thread Christoph Moench-Tegeder
## sighup (r...@sighup.eu): > How can I extract the value of the 'items' key either as two rows and or > a sum of both. select id, jsonb_array_elements(markers)->>'items' from data; And as jsonb_array_elements() returns a setof jsonb: with tab(id, items) as ( select id, (jsonb_array_elements(m

Re: [GENERAL] Returning values from an array of JSONB objects.

2016-04-13 Thread sighup
On 13/04/2016 11:53, Vitaly Burovoy wrote: On 4/13/16, Vitaly Burovoy wrote: On 4/13/16, sighup wrote: Hi, please excuse either my stupidity or naivety regarding this but I'm a bit confused. Give the following basic table structure : TABLE Data ( ID INT NOT NULL, Markers json

Re: [GENERAL] Returning values from an array of JSONB objects.

2016-04-13 Thread Vitaly Burovoy
On 4/13/16, Vitaly Burovoy wrote: > On 4/13/16, sighup wrote: >> Hi, please excuse either my stupidity or naivety regarding this but I'm >> a bit confused. Give the following basic table structure : >> >> TABLE Data ( >> ID INT NOT NULL, >> Markers jsonb NOT NULL >> ); >> >> And the fol

Re: [GENERAL] Returning values from an array of JSONB objects.

2016-04-13 Thread Vitaly Burovoy
On 4/13/16, sighup wrote: > Hi, please excuse either my stupidity or naivety regarding this but I'm > a bit confused. Give the following basic table structure : > > TABLE Data ( > ID INT NOT NULL, > Markers jsonb NOT NULL > ); > > And the following data: > > INSERT INTO Data (ID, Marke