Re: New array functions - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: New array functions
Date
Msg-id 1062103952.3132.7.camel@fuji.krosing.net
Whole thread Raw
In response to Re: New array functions  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Nasty problem in hash indexes
Next
From: Sean Chittenden
Date:
Subject: [seanc@FreeBSD.org: Re: Performance tests I did with FreeBSD, Linux and PostgreSQL]