Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0QJ4Bq36027 for ; Fri, 26 Jan 2001 14:04:11 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0QJ41903465; Fri, 26 Jan 2001 14:04:01 -0500 (EST) To: josh@agliodbs.com cc: sqllist Subject: Re: Request for change in PL/PGSQL function handler In-reply-to: <3A71B396.43FB80D@agliodbs.com> References: <3A71B396.43FB80D@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Fri, 26 Jan 2001 09:27:50 -0800" Date: Fri, 26 Jan 2001 14:04:00 -0500 Message-ID: <3462.980535840@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/394 X-Sequence-Number: 1067 Josh Berkus writes: > Currently (7.0.3) the PLPGSQL function compiler permits only one RETURN > statment, at the end of the function. RETURN statements placed > elsewhere cause a compile error. Say what? regression=# create function foo(int) returns int as ' regression'# begin regression'# if $1 > 10 then return $1; regression'# end if; regression'# return $1 - 1; regression'# end;' language 'plpgsql'; CREATE regression=# select foo(1); foo ----- 0 (1 row) regression=# select foo(100); foo ----- 100 (1 row) regression=# Works fine for me in both 7.0.2 and current. regards, tom lane