Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY
Date
Msg-id 1186.1343666173@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-bugs
Jan Wieck <JanWieck@Yahoo.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

pgsql-bugs by date:

Previous
From: Jan Wieck
Date:
Subject: Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY
Next
From: Craig Ringer
Date:
Subject: Re: BUG #6751: usage flaws in pg_restore