Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates
Date
Msg-id 8638.1261769192@sss.pgh.pa.us
Whole thread Raw
In response to Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2009/12/25 Tom Lane <tgl@sss.pgh.pa.us>:
>> No, because you could have more than one ORDER BY item.

> hmm - this isn't bullet-prof design :(

I notice that ORDER BY 'x' draws an error at the query level but not
within aggregates or window functions.  I wonder if we should have the
"SQL99" ORDER BY code throw an error for a simple literal ORDER BY item.
There isn't any visible use for ordering by a constant, and this would
catch some possible misunderstandings.  For instance, it would have
complained about Pavel's original example in this thread, and we could
word the error message to make it clear that the system thinks that's
an ORDER BY value not an aggregate argument.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: info about patch: using parametrised query in psql
Next
From: Tom Lane
Date:
Subject: Re: info about patch: using parametrised query in psql