Re: Selecting a JSON object of arrays from a PostgreSQL table

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Selecting a JSON object of arrays from a PostgreSQL table
Date: 2018-01-01 16:15:54
Message-ID: CAADeyWh6hbrNdqnR5caxjZC3vdW4cogxn=nANjFv3_zRX6qhFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Ivan,

On Mon, Jan 1, 2018 at 3:34 PM, Ivan E. Panchenko <
i(dot)panchenko(at)postgrespro(dot)ru> wrote:

>
> select json_object_agg(gid, y) from
> (
> select gid, jsonb_agg(row_to_json(chat)) y
> from chat
> group by gid
> ) x;
>
>
> 01.01.2018 16:41, Alexander Farber пишет:
>
>>
>> I have prepared a simple SQL Fiddle demonstrating my problem:
>> http://sqlfiddle.com/#!17/2c9c5/1
>>
>>
that is great, thank you!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Moore 2018-01-01 16:56:13 Slow system due to ReorderBufferGetTupleBuf?
Previous Message Ivan E. Panchenko 2018-01-01 14:34:17 Re: Selecting a JSON object of arrays from a PostgreSQL table