I've tried to write a plpgsql function, and noticed the following
problem : (7.1RC2 rpm from postgresql.org)

When issuing a comand like:
DECLARE
  rowvar tablaname%ROWTYPE
BEGIN
  FOR rowvar IN SELECT FROM tablename t WHERE t.xxx=yyy AND t.zzz=qqq
  LOOP
  .....
  END LOOP;

or just simply issuing a query like

DECLARE
  rownum int4:=0;
BEGIN
  SELECT count (*)::int4 INTO rownum FROM tablename t WHERE t.xxx=yyy
  AND t.zzz=qqq;

only the t.zzz=qqq is realized in the returned rows, the t.xxx=yyy is
skipped, but when executing the query with execute everything is fine.
Is this an undocumented bug? I've noticed that the same query
structure is avoided in the documentation, you use simple queryes with
only one filtering condition... :(



Tue, 10 Apr 2001 09:31:32 +0200
Lehel Gyuro <lehel@bin.hu>
Maybe a plpgsql bug?
Lehel Gyuro <lehel@bin.hu> writes:
> I've tried to write a plpgsql function, and noticed the following
> problem : (7.1RC2 rpm from postgresql.org)

Perhaps this is a bug, but you have not given a complete example that
would allow someone else to try to reproduce it.  Please see the
guidelines for bug reports.

			regards, tom lane

Fri, 13 Apr 2001 13:22:38 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Maybe a plpgsql bug? 