Re: Support for OUT parameters in procedures

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Support for OUT parameters in procedures
Дата
Msg-id 7c2aa288-74fd-fe0a-58bb-d77055315047@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Support for OUT parameters in procedures  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Support for OUT parameters in procedures  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Handing off SLRU fsyncs to the checkpointer
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior