Re: New array functions

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: New array functions
Date: 2003-08-28 18:45:22
Message-ID: 871xv5liyl.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)com> writes:

> Greg Stark wrote:
> > So where are the new array functions and syntaces documented?
>
> Mainly here:
> http://developer.postgresql.org/docs/postgres/arrays.html

excellent. thank you.

> > 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?

indeed in contrib/intagg

> 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 = '{}'
> );

Hm, perhaps there should be a standard name for this, rather than have
everyone's code do their own thing.

> 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.

That's exactly what it does. Hm, I guess I misinterpreted that post. Hm I have
some work to do.

Thanks. And thanks a LOT for doing the work, it'll makes a big difference
and make arrays much more practical to use.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-08-28 18:50:25 Re: bug with constraint dependencies? or bug with
Previous Message Tom Lane 2003-08-28 18:43:09 Re: bug with constraint dependencies? or bug with

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-08-28 19:13:46 Re: New array functions
Previous Message Joe Conway 2003-08-28 18:15:05 Re: New array functions