Re: how can I select into an array?

From: Joe Conway <mail(at)joeconway(dot)com>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: Andy Kriger <akriger(at)greaterthanone(dot)com>, Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: how can I select into an array?
Date: 2004-02-06 17:14:36
Message-ID: 4023CB7C.7090809@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2004-02-06 17:17:04 Re: Casting 'record' to a composite type.
Previous Message Tom Lane 2004-02-06 17:08:16 Re: how can I select into an array?