Re: [GENERAL] CREATE AGGREGATE on jsonb concat - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] CREATE AGGREGATE on jsonb concat
Date
Msg-id 27317.1499370813@sss.pgh.pa.us
Whole thread Raw
In response to [GENERAL] CREATE AGGREGATE on jsonb concat  (Seamus Abshere <seamus@abshere.net>)
Responses Re: [GENERAL] CREATE AGGREGATE on jsonb concat  (Seamus Abshere <seamus@abshere.net>)
List pgsql-general
Seamus Abshere <seamus@abshere.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


pgsql-general by date:

Previous
From: Justin Pryzby
Date:
Subject: [GENERAL] huge RAM use in multi-command ALTER of table heirarchy
Next
From: Seamus Abshere
Date:
Subject: Re: [GENERAL] CREATE AGGREGATE on jsonb concat