Re: Should we still require RETURN in plpgsql?

From: Dennis Bjorklund
Subject: Re: Should we still require RETURN in plpgsql?
Date: ,
Msg-id: Pine.LNX.4.44.0504050900340.16409-100000@zigo.dhs.org
(view: Whole thread, Raw)
In response to: Should we still require RETURN in plpgsql?  (Tom Lane)
Responses: Re: Should we still require RETURN in plpgsql?  (Tom Lane)
List: pgsql-hackers

Tree view

Should we still require RETURN in plpgsql?  (Tom Lane, )
 Re: Should we still require RETURN in plpgsql?  (Christopher Kings-Lynne, )
 Re: Should we still require RETURN in plpgsql?  (Dennis Bjorklund, )
  Re: Should we still require RETURN in plpgsql?  (Tom Lane, )
   Re: Should we still require RETURN in plpgsql?  (Robert Treat, )
    Re: Should we still require RETURN in plpgsql?  (Tom Lane, )
     Re: Should we still require RETURN in plpgsql?  (Oleg Bartunov, )
      Re: Should we still require RETURN in plpgsql?  (Tom Lane, )
 Re: Should we still require RETURN in plpgsql?  (Terry Yapt, )

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 RETURN statement is kinda useless in this example, but it is still
> required, because we don't allow control to fall off the end of a
> plpgsql function without causing an error.
> 
> I am thinking we should allow exit by falling off the end of the
> function when (a) it has output parameter(s), or (b) it is declared
> "RETURNS void".  Comments?

The above code example do not have any RETURNS clause, does that mean that 
it defaults to RETURNS void?

I don't see what (a) has to do with anything. The return value is
independent of in/out:ness of the parameters, isn't it?

-- 
/Dennis Björklund




pgsql-hackers by date:

From: "Andrew Dunstan"
Date:
Subject: Re: [GENERAL] plPHP in core?
From: Martín Marqués
Date:
Subject: Re: [GENERAL] plPHP in core?