Re: RFC: array_agg() per SQL:200n

From: Neil Conway <neilc(at)samurai(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: RFC: array_agg() per SQL:200n
Date: 2008-02-03 05:49:17
Message-ID: 1202017757.13868.7.camel@goldbach
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2008-01-29 at 13:06 +0100, Peter Eisentraut wrote:
> The ORDER BY clause would also used in XMLAGG, so we should try to parse this
> in a generalized way.

Yeah, that should be doable. We could go further and expose ORDER BY to
CREATE AGGREGATE, so that users could write aggregates that are
guaranteed to see their input in a certain order. This would be rather
more complicated to implement, though (for one thing, you couldn't do
the "qsort in the final function" trick -- the input to the agg would
need to be presented in the right order, which might differ from the
ordering required by the rest of the query block. We'll need to arrange
for something vaguely similar to do window functions, though.)

-Neil

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-02-03 10:48:24 Re: FW: bitemporal functionality for PostgreSQL
Previous Message Gurjeet Singh 2008-02-03 05:14:37 Re: Wrong query examples in docs