pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Support for OUT parameters in procedures
Date: Fri, 28 Aug 2020 08:04:04 +0200
Message-ID: <7c2aa288-74fd-fe0a-58bb-d77055315047@2ndquadrant.com> (raw)
In-Reply-To: <CA+TgmobV5QdvDq7LJbRYULi9U7dUQnYz8MzhVmgMrDUmEUV4VQ@mail.gmail.com>
References: <2b8490fe-51af-e671-c504-47359dc453c5@2ndquadrant.com>
	<CA+TgmobV5QdvDq7LJbRYULi9U7dUQnYz8MzhVmgMrDUmEUV4VQ@mail.gmail.com>

On 2020-08-27 15:56, Robert Haas wrote:
> On Thu, Aug 27, 2020 at 4:34 AM Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
>> For a top-level direct call, you can pass whatever you want, since all
>> OUT parameters are presented as initially NULL to the procedure code.
>> So you could just pass NULL, as in CALL test_proc(5, NULL).
> 
> Is that actually how other systems work? I would think that people
> would expect to pass, say, a package variable, and expect that it will
> get updated.

The handling of results of SQL statements executed at the top level 
(a.k.a. direct SQL) is implementation-specific and varies widely in 
practice.  More interesting in practice, in terms of functionality and 
also compatibility, are nested calls in PL/pgSQL as well as integration 
in JDBC.

We already support INOUT parameters in procedures, so the method of 
returning the value of output parameters after the CALL already exists. 
This patch doesn't touch that at all, really.  If we had or would add 
other places to put those results, such as package variables, then they 
could be added independently of this patch.

Of course, feedback from those more knowledgeable in other systems than 
me would be welcome.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (13+ messages)  latest in thread

Message-ID: <7c2aa288-74fd-fe0a-58bb-d77055315047@2ndquadrant.com>
Permalink:  ../7c2aa288-74fd-fe0a-58bb-d77055315047@2ndquadrant.com/
Also on:    postgresql.org/message-id/7c2aa288-74fd-fe0a-58bb-d77055315047@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 using the --to and --cc options:
  reply via email

  To: pgsql-jdbc@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Support for OUT parameters in procedures
  In-Reply-To: <7c2aa288-74fd-fe0a-58bb-d77055315047@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