Re: at for over select rows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: al_nunes(at)atua(dot)com(dot)br
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: at for over select rows
Date: 2003-05-29 04:13:10
Message-ID: 14093.1054181590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

al_nunes(at)atua(dot)com(dot)br writes:
> NOTICE: Error occurred while executing PL/pgSQL function apaga_constraint
> NOTICE: line 20 at for over select rows
> ERROR: parser: parse error at or near "$1"

> DECLARE
> qtd INTEGER;
^^^

> FOR registro IN
> SELECT t.tgrelid, COUNT(t.tgname) AS qtd
^^^

Never use a name in an SQL statement that is the same as a name you've
declared as a plpgsql variable, unless your intent is for the value of
that variable to be substituted at that point in the statement. Which
is certainly not what you want here.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sean Chittenden 2003-05-29 06:13:03 Re: segv's on CREATE INDEX with recent HEAD...
Previous Message al_nunes 2003-05-29 02:50:57 at for over select rows