Seamus Abshere writes:
> That aggregates into an array. Our `jsonb_collect` aggregates into an object.
Postgres 9.6 has (per
https://www.postgresql.org/docs/9.6/static/functions-aggregate.html):
* jsonb_agg(expression)
* jsonb_object_agg(name, value)
In retrospect, I think
> Seamus Abshere 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
Seamus Abshere 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
hi,
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.
Thanks for your advice,