CREATE AGGREGATE array_cat

From: Vlad Bokov <vlad(at)razum2um(dot)me>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: CREATE AGGREGATE array_cat
Date: 2020-11-18 19:43:17
Message-ID: 89b89b20-27ea-8079-d3c0-3127d7f68ec4@razum2um.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, I wonder why there's no function to aggregate arrays by
concatenation out of the box?

There is a usual function `array_cat(anyarray, anyarray)`, but it
doesn't seamlessly work with grouping.

Wouldn't it be natural to have this:

CREATE AGGREGATE array_cat (anyarray)
(
    sfunc = array_cat,
    stype = anyarray,
    initcond = '{}'
);

Thanks,
Vlad

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-11-18 20:21:06 Re: pl/pgsql feature request: shorthand for argument and local variable references
Previous Message Andres Freund 2020-11-18 19:09:28 Re: remove spurious CREATE INDEX CONCURRENTLY wait