Re: CREATE AGGREGATE on jsonb concat

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Seamus Abshere <seamus(at)abshere(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE AGGREGATE on jsonb concat
Date: 2017-07-06 19:53:33
Message-ID: 27317.1499370813@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Seamus Abshere <seamus(at)abshere(dot)net> writes:
> We do this in our database:

> CREATE AGGREGATE jsonb_collect(jsonb) (
> SFUNC = 'jsonb_concat',
> STYPE = jsonb,
> INITCOND = '{}'
> );

> Is there some other built-in aggregate I'm missing that would do the
> same thing? It just feels like such an obvious feature.

Doesn't jsonb_agg() do exactly that?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Seamus Abshere 2017-07-06 20:12:18 Re: CREATE AGGREGATE on jsonb concat
Previous Message Justin Pryzby 2017-07-06 18:04:20 huge RAM use in multi-command ALTER of table heirarchy