Skip site navigation (1) Skip section navigation (2)

Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Boris Folgmann <boris(at)folgmann(dot)de>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY
Date: 2012-07-30 16:36:13
Message-ID: 1186.1343666173@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
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 LunkesDate: 2012-07-30 23:31:20
Subject: Re: BUG #6768: Failure in OBDC
Previous:From: Jan WieckDate: 2012-07-30 16:21:38
Subject: Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group