From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: "Johnny Jørgensen" <pgsql@halfahead.dk>
Cc: pgsql-sql@postgresql.org
Subject: Re: PL/pgSQL loops?
Date: Thu, 29 Nov 2001 12:02:55 -0500
Message-ID: <19090.1007053375@sss.pgh.pa.us> (raw)
In-Reply-To: <20011129073009.E43179-100000@megazone23.bigpanda.com>
References: <20011129073009.E43179-100000@megazone23.bigpanda.com>
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> In addition, this seems to work:
> for intvar in 1 .. (select max(a) from a) LOOP
> and this doesn't:
> for intvar in 1 .. (select max(loop) from a) LOOP
> and this does:
> for intvar in (select max(loop) from a) .. 1 LOOP
> I'm guessing that plpgsql doesn't want to try to determine if
> an expression is valid and so just concats stuff to pass off,
Correct ...
> but that seems to mean that you need to double quote loop in
> the second (which is somewhat unobvious).
I would've expected it to count nested parentheses, at least.
A quick look makes it appear that some places in plpgsql's
gram.y do, and some don't. Ugh.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, sszabo@megazone23.bigpanda.com, pgsql@halfahead.dk
Subject: Re: PL/pgSQL loops?
In-Reply-To: <19090.1007053375@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