Aggregate Array

From PostgreSQL wiki
Jump to navigationJump to search

The buildin array_agg() have different behaviour, here using array_cat().

array_aggcat(anyelement)

Snippets

Aggregate array

Works with PostgreSQL

Any version

Written in

SQL

Depends on

Nothing

This snippet is also part of the ulib_agg user-defined library.

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