Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> Note that PL/pgSQL replaces all local variables inside a query with
> $-parameters for the prepared SPI plan. The parser rejects ordering by
> non-integer constants, but it does not reject ordering by $-parameters
> or constant expressions. (maybe it should).
The only real reason it complains about simple constants is that
otherwise people might think "ORDER BY 1" means something different
than what it does mean according to SQL92. Otherwise, if you want
to sort by a constant, who are we to stop you?
regards, tom lane
In response to
pgsql-bugs by date
|Next:||From: Fábio Hentz Lunkes||Date: 2012-07-30 23:31:20|
|Subject: Re: BUG #6768: Failure in OBDC|
|Previous:||From: Jan Wieck||Date: 2012-07-30 16:21:38|
|Subject: Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY|