pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Simon Riggs <simon@2ndquadrant.com>
Subject: Re: [HACKERS] SQL procedures
Date: Wed, 22 Nov 2017 14:18:26 -0500
Message-ID: <7ac4688b-c210-1baa-3586-b37df3075fec@2ndQuadrant.com> (raw)
In-Reply-To: <27201.1511374216@sss.pgh.pa.us>
References: <336f6926-8990-ff2d-4167-276ce417fc32@2ndquadrant.com>
	<CANP8+j+tKw9pzdmsMrehEQbQ=FEuKbu3OEDsrD77S+jBhByTww@mail.gmail.com>
	<492a8be0-ff55-3858-7dc1-62fa07d444c2@2ndquadrant.com>
	<6fbe425b-0b9b-0b3f-c5bb-5a5111514867@2ndquadrant.com>
	<fd3d1477-a386-5f59-7e8c-e88967300d81@2ndQuadrant.com>
	<67fa3f8d-7203-702b-40a3-514eba7e1c05@2ndquadrant.com>
	<27201.1511374216@sss.pgh.pa.us>



On 11/22/2017 01:10 PM, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> On 11/20/17 16:25, Andrew Dunstan wrote:
>>> We should document where returned values in PL procedures are ignored
>>> (plperl, pltcl) and where they are not (plpython, plpgsql). Maybe we
>>> should think about possibly being more consistent here, too.
>> Yeah, suggestions?  I think it makes sense in PL/pgSQL and PL/Python to
>> disallow return values that would end up being ignored, because the only
>> way a return value could arise is if user code explicit calls
>> RETURN/return.  However, in Perl, the return value is the result of the
>> last statement, so prohibiting a return value would be very
>> inconvenient.  (Don't know about Tcl.)  So maybe the current behavior
>> makes sense.  Documentation is surely needed.
> Tcl has the same approach as Perl: the return value of a proc is the
> same as the value of its last command.  There's no such thing as a
> proc that doesn't return a value.
>
> 			


Right. We probably just need to document the behaviour here. I'd be
satisfied with that.

cheers

andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (57+ messages)  latest in thread

Message-ID: <7ac4688b-c210-1baa-3586-b37df3075fec@2ndQuadrant.com>
Permalink:  ../7ac4688b-c210-1baa-3586-b37df3075fec@2ndQuadrant.com/
Also on:    postgresql.org/message-id/7ac4688b-c210-1baa-3586-b37df3075fec@2ndQuadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: andrew.dunstan@2ndquadrant.com, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, simon@2ndquadrant.com
  Subject: Re: [HACKERS] SQL procedures
  In-Reply-To: <7ac4688b-c210-1baa-3586-b37df3075fec@2ndQuadrant.com>
  References: <336f6926-8990-ff2d-4167-276ce417fc32@2ndquadrant.com> <CANP8+j+tKw9pzdmsMrehEQbQ=FEuKbu3OEDsrD77S+jBhByTww@mail.gmail.com> <492a8be0-ff55-3858-7dc1-62fa07d444c2@2ndquadrant.com> <6fbe425b-0b9b-0b3f-c5bb-5a5111514867@2ndquadrant.com> <fd3d1477-a386-5f59-7e8c-e88967300d81@2ndQuadrant.com> <67fa3f8d-7203-702b-40a3-514eba7e1c05@2ndquadrant.com> <27201.1511374216@sss.pgh.pa.us> <7ac4688b-c210-1baa-3586-b37df3075fec@2ndQuadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox