Aggregate Array
From PostgreSQL wiki
Jump to navigationJump to searchThe buildin array_agg() have different behaviour, here using array_cat().
array_aggcat(anyelement)
This snippet is also part of the ulib_agg user-defined library.
CREATE AGGREGATE array_aggcat (anyelement) ( sfunc = array_cat, stype = anyarray, initcond = '{}' );