Re: Should we still require RETURN in plpgsql?

From: Tom Lane
Subject: Re: Should we still require RETURN in plpgsql?
Date: ,
Msg-id: 13728.1112714541@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Re: Should we still require RETURN in plpgsql?  (Robert Treat)
Responses: Re: Should we still require RETURN in plpgsql?  (Oleg Bartunov)
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, )

Robert Treat <> writes:
> 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?

It's about the same either way as far as the code is concerned.  But
I've only written a dozen or so plpgsql functions using OUT parameters,
and I've already found having to write a useless RETURN to be tedious
(not to mention that I forgot it a couple times).  I don't think I'll be
the last one complaining if we leave in the requirement.

Basically the requirement exists to make sure you don't forget to define
the return value.  But when you're using OUT parameters, the existence
of a RETURN statement has nothing to do with defining the return value.
        regards, tom lane



pgsql-hackers by date:

From: Tom Lane
Date:
Subject: Re: [GENERAL] Vacuum time degrading
From: "Joshua D. Drake"
Date:
Subject: REINDEX ALL