Re: CREATE AGGREGATE on jsonb concat

From: Seamus Abshere <seamus(at)abshere(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE AGGREGATE on jsonb concat
Date: 2017-07-06 20:12:18
Message-ID: 1499371938.1646099.1032751664.29834335@webmail.messagingengine.com
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.

> On Thu, Jul 6, 2017, at 04:53 PM, Tom Lane wrote:
> Doesn't jsonb_agg() do exactly that?

hi Tom,

That aggregates into an array. Our `jsonb_collect` aggregates into an
object.

Best,
Seamus

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tamás András Kálmán 2017-07-06 20:54:06 Modified rows are not marked as dead and as such vacuum is unable to clean them up
Previous Message Tom Lane 2017-07-06 19:53:33 Re: CREATE AGGREGATE on jsonb concat