Re: Aggregate ORDER BY patch - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Aggregate ORDER BY patch
Date
Msg-id 87k4xupbl1.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Aggregate ORDER BY patch  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Aggregate ORDER BY patch
List pgsql-hackers
>>>>> "Heikki" == Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> No artificial restrictions are imposed on what syntactical>> combinations are allowed. However, ORDER BY is not
allowedwith>> aggregates used as window functions (as per the existing>> restriction on DISTINCT).
 
Heikki> How is this different from window functions?

Window functions return a row for each row of input, aggregates don't.

The reason I didn't tackle the case of aggregate functions used as
window functions is that the spec allows constructs like this:

array_agg(a order by b) over (order by c)

which can't be represented using the aggregate-as-window-function
mechanism as it currently stands, since you'd have to re-sort the
window each time.

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: cvs head doesn't pass make check on one of the machines here
Next
From: Robert Haas
Date:
Subject: Re: next CommitFest