Re: how can I select into an array? - Mailing list pgsql-general

From Joe Conway
Subject Re: how can I select into an array?
Date
Msg-id 4023CB7C.7090809@joeconway.com
Whole thread Raw
In response to Re: how can I select into an array?  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
List 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



pgsql-general by date:

Previous
From: Franco Bruno Borghesi
Date:
Subject: Re: newbie question... how do I get table structure?
Next
From: Franco Bruno Borghesi
Date:
Subject: Re: retrieving parts of a resultset