Confused with LABEL and LOOP

From: "Patrick Fiche" <patrick(dot)fiche(at)aqsacom(dot)com>
To: "Pgsql-General (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Confused with LABEL and LOOP
Date: 2004-10-12 13:46:05
Message-ID: 013501c4b061$d2e6bdb0$2e01a8c0@pc3648pfi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm a bit confused with the use of Label for loops in PostgreSQL.
I'm using PostgreSQL 8.0 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gaetano Mendola 2004-10-12 14:14:40 Re: OS not good for database
Previous Message Michael Glaesemann 2004-10-12 13:11:20 Re: 'NOW' in UTC with no timezone