Re: Aggregate ORDER BY patch

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: heikki.linnakangas@enterprisedb.com (Heikki Linnakangas), pgsql-hackers@postgresql.org
Date: 2009-11-13T16:32:41Z
Lists: pgsql-hackers
>>>>> "Heikki" == Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

 >> Herewith a patch to implement agg(foo ORDER BY bar) with or
 >> without DISTINCT, etc.

 Heikki> What does that mean? Aggregate functions are supposed to be
 Heikki> commutative, right?

The SQL spec defines two non-commutative aggregates that we implement:

array_agg(x ORDER BY ...)
xmlagg(x ORDER BY ...)

In addition, of course, we allow user-defined aggregates, which are
perfectly free to be non-commutative.

-- 
Andrew (irc:RhodiumToad)