Pavel Stehule wrote:
> CREATE AGGREGATE aggarray (BASETYPE = ANYELEMENT, SFUNC = aggregate_array,
> STYPE = ANYARRAY);
Or, from the docs, see:
http://www.postgresql.org/docs/current/static/xaggr.html
CREATE AGGREGATE array_accum (
sfunc = array_append,
basetype = anyelement,
stype = anyarray,
initcond = '{}'
);
array_append() is built-in in 7.4 -- and note both Pavel's solution and
this one require 7.4.x
HTH,
Joe