Re: New array functions

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New array functions
Date: 2003-08-28 20:52:32
Message-ID: 1062103952.3132.7.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Joe Conway kirjutas N, 28.08.2003 kell 21:15:
> Greg Stark wrote:
> > Specifically I want to know how to replace my int_array_aggregate(int) and
> > int_array_enum(_int) calls.
>
> I have no idea what those are -- are they from contrib?
>
> You can create an aggregate to turn arbitrary datatype elements into
> arrays like this:
>
> CREATE AGGREGATE array_aggregate
> (
> BASETYPE = anyelement,
> SFUNC = array_append,
> STYPE = anyarray,
> INITCOND = '{}'
> );

Any idea of performance - is this array_aggregate(anyelement) faster,
slower or about same than int_array_aggregate(int) ?

> If int_array_enum() is supposed to take '{1,2,3}' and produce three
> rows, that function was proposed but rejected. Subsequently Peter
> Eisentraut pointed out a SQL99 syntax that does this, but I did not get
> it done for 7.4. Perhaps for 7.5.

So we got to keep intagg at least until 7.5 ...

-----------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Schoebel-Theuer 2003-08-28 20:53:39 Obscure: correctness of lock manager???
Previous Message Tom Lane 2003-08-28 20:51:11 Re: Bumping block size to 16K on FreeBSD...

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-08-28 21:05:05 Re: New array functions
Previous Message Joe Conway 2003-08-28 20:51:09 Re: New array functions