Re: Should we still require RETURN in plpgsql? - Mailing list pgsql-hackers

From Robert Treat
Subject Re: Should we still require RETURN in plpgsql?
Date
Msg-id 1112706080.26170.278.camel@camel
Whole thread Raw
In response to Re: Should we still require RETURN in plpgsql?  (Tom Lane)
Responses Re: Should we still require RETURN in plpgsql?  (Tom Lane)
List pgsql-hackers
On Tue, 2005-04-05 at 03:43, Tom Lane wrote:
> Dennis Bjorklund <> writes:
> > On Tue, 5 Apr 2005, Tom Lane wrote:
> >> CREATE FUNCTION sum_n_product(x int, y int, OUT sum int, OUT prod int) AS $$
> >> BEGIN
> >> sum := x + y;
> >> prod := x * y;
> >> RETURN;
> >> END;
> >> $$ LANGUAGE plpgsql;
> 
> > The above code example do not have any RETURNS clause, does that mean that 
> > it defaults to RETURNS void?
> 
> No, it effectively "RETURNS record", where the particular record type is
> implied by the set of output parameters.  See my previous proposal.
> 

While it is useless in this example, istm it only makes things more
confusing to require return in some cases but not in others.  Is there
some technical advantage to dropping it?


Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



pgsql-hackers by date:

Previous
From: Martín Marqués
Date:
Subject: Re: [GENERAL] plPHP in core?
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] plPHP in core?