Re: Request for change in PL/PGSQL function handler

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: sqllist <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Request for change in PL/PGSQL function handler
Date: 2001-01-26 19:04:00
Message-ID: 3462.980535840@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Josh Berkus <josh(at)agliodbs(dot)com> 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2001-01-26 19:05:30
Previous Message Emils Klotins 2001-01-26 18:45:08 Re: DATE