pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 01:08:36 -0500
Message-ID: <15769.1007014116@sss.pgh.pa.us> (raw)
In-Reply-To: <20011128194857.G37828-100000@megazone23.bigpanda.com>
References: <20011128194857.G37828-100000@megazone23.bigpanda.com>

Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> Something like the below seemed to make it work for me under
> 7.2b3:

Oh ... duh!  I've been bit by that before myself.  In the original,
since the FOR loops were using integer variables (not record or rowtype
variables as they should've), the plpgsql parser was expecting an
integer FOR-loop.  Which goes like

	FOR ivar IN expression .. expression LOOP stmts END LOOP;

Evidently, somewhere around the END LOOP it realized that it was missing
the .. part of the construct.

I've mumbled before that it's bad form to be using the declared type
of the FOR variable to drive the syntaxing of FOR loops --- poor error
recovery and unhelpful error messages are exactly the reasons why.
Not sure that this can easily be fixed, however.

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <15769.1007014116@sss.pgh.pa.us>
Permalink:  ../15769.1007014116@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15769.1007014116@sss.pgh.pa.us

 · 

reply

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: <15769.1007014116@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