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