Re: Should we still require RETURN in plpgsql?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Should we still require RETURN in plpgsql?
Date: 2005-04-05 07:43:39
Message-ID: 10862.1112687019@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Terry Yapt 2005-04-05 07:51:05 Re: Should we still require RETURN in plpgsql?
Previous Message Dennis Bjorklund 2005-04-05 07:04:30 Re: Should we still require RETURN in plpgsql?