Re: RFC: array_agg() per SQL:200n - Mailing list pgsql-hackers

From Neil Conway
Subject Re: RFC: array_agg() per SQL:200n
Date
Msg-id 1202017757.13868.7.camel@goldbach
Whole thread Raw
In response to Re: RFC: array_agg() per SQL:200n  (Peter Eisentraut <peter_e@gmx.net>)
List 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




pgsql-hackers by date:

Previous
From: "Gurjeet Singh"
Date:
Subject: Re: Wrong query examples in docs
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: FW: bitemporal functionality for PostgreSQL