Possible bug with LABEL and LOOP in 8.0

From: "Patrick Fiche" <patrick(dot)fiche(at)aqsacom(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Possible bug with LABEL and LOOP in 8.0
Date: 2004-10-12 10:05:10
Message-ID: 011b01c4b042$f646c620$2e01a8c0@pc3648pfi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

It seems to me that a bug was introduced in 8.0 version.
(I was previously using 7.2.3 so I don't really know in which version the
comportment changed...).
I'm using Beta2 version on WIN32 platform.

----------------------------------------------------------------------------
--------
CREATE OR REPLACE FUNCTION TEST( ) RETURNS int4 AS '

BEGIN

<<LOOP1>>
LOOP
Raise Notice ''Loop 1'';

EXIT LOOP1;
END LOOP;

RETURN 0;

END'
LANGUAGE 'plpgsql';
----------------------------------------------------------------------------
--------

When I call SELECT TEST(), I get the error message :
ERROR: control reached end of function without RETURN
CONTEXT: PL/pgSQL function "test"

If I just change EXIT LOOP1 to EXIT -> everything is OK
I think we previously had the possibility to indicate the LABEL in EXIT
statement...

Regards,

Patrick

---------------------------------------------------------------------------
----------------
Patrick Fiche
email : patrick(dot)fiche(at)aqsacom(dot)com
----------------------------------------------------------------------------
---------------

Protected by Polesoft Lockspam
http://www.polesoft.com/refer.html

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2004-10-12 12:20:53 Re: 'NOW' in UTC with no timezone
Previous Message xiaoling he 2004-10-12 09:16:27 Is it a memory lost of PQmakeEmptyPGresult?