From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Wieck <JanWieck@Yahoo.com>
Cc: Boris Folgmann <boris@folgmann.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY
Date: Mon, 30 Jul 2012 12:36:13 -0400
Message-ID: <1186.1343666173@sss.pgh.pa.us> (raw)
In-Reply-To: <5016B492.5030807@Yahoo.com>
References: <E1Sulxi-0003NK-5i@wrigleys.postgresql.org>
<20120727160324.GA11439@depesz.com>
<jv5lok$1bmr$1@news.hub.org>
<5016B492.5030807@Yahoo.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, JanWieck@Yahoo.com, boris@folgmann.de
Subject: Re: BUG #6774: FOR IN SELECT LOOP ignores ORDER BY
In-Reply-To: <1186.1343666173@sss.pgh.pa.us>
References: <E1Sulxi-0003NK-5i@wrigleys.postgresql.org> <20120727160324.GA11439@depesz.com> <jv5lok$1bmr$1@news.hub.org> <5016B492.5030807@Yahoo.com> <1186.1343666173@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox