mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Support INOUT arguments in procedures
In a top-level CALL, the values of INOUT arguments will be returned as a result row. In PL/pgSQL, the values are assigned back to the input arguments. In other languages, the same convention as for return a record from a function is used. That does not require any code changes in the PL implementations. Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>
This commit is contained in:
@@ -186,6 +186,18 @@ $$ LANGUAGE pltcl;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Output arguments of procedures are returned in the same way, for example:
|
||||
|
||||
<programlisting>
|
||||
CREATE PROCEDURE tcl_triple(INOUT a integer, INOUT b integer) AS $$
|
||||
return [list a [expr {$1 * 3}] b [expr {$2 * 3}]]
|
||||
$$ LANGUAGE pltcl;
|
||||
|
||||
CALL tcl_triple(5, 10);
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
<para>
|
||||
The result list can be made from an array representation of the
|
||||
|
Reference in New Issue
Block a user