Re: [GENERAL] CREATE AGGREGATE on jsonb concat

2017-07-10 Thread Seamus Abshere
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

Re: [GENERAL] CREATE AGGREGATE on jsonb concat

2017-07-06 Thread Seamus Abshere
> 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

Re: [GENERAL] CREATE AGGREGATE on jsonb concat

2017-07-06 Thread Tom Lane
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

[GENERAL] CREATE AGGREGATE on jsonb concat

2017-07-06 Thread Seamus Abshere
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,