Re: [GENERAL] CREATE AGGREGATE on jsonb concat

Поиск
Список
Период
Сортировка
От Seamus Abshere
Тема Re: [GENERAL] CREATE AGGREGATE on jsonb concat
Дата
Msg-id 1499371938.1646099.1032751664.29834335@webmail.messagingengine.com
обсуждение исходный текст
Ответ на Re: [GENERAL] CREATE AGGREGATE on jsonb concat  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] CREATE AGGREGATE on jsonb concat
Список 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.

> 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] CREATE AGGREGATE on jsonb concat
Следующее
От: Tamás András Kálmán
Дата:
Сообщение: [GENERAL] Modified rows are not marked as dead and as such vacuum is unable toclean them up