Re: Should we still require RETURN in plpgsql?

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should we still require RETURN in plpgsql?
Date: 2005-04-05 13:01:19
Message-ID: 1112706080.26170.278.camel@camel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2005-04-05 at 03:43, Tom Lane wrote:
> Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Marlowe 2005-04-05 14:41:05 Re: [HACKERS] plPHP in core?
Previous Message Martín Marqués 2005-04-05 12:25:56 Re: [HACKERS] plPHP in core?