Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

Next:From: Terry YaptDate: 2005-04-05 07:51:05
Subject: Re: Should we still require RETURN in plpgsql?
Previous:From: Dennis BjorklundDate: 2005-04-05 07:04:30
Subject: Re: Should we still require RETURN in plpgsql?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group