mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +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:
@@ -649,6 +649,17 @@ return (1, 2)
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
SELECT * FROM multiout_simple();
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Output parameters of procedures are passed back the same way. For example:
|
||||
<programlisting>
|
||||
CREATE PROCEDURE python_triple(INOUT a integer, INOUT b integer) AS $$
|
||||
return (a * 3, b * 3)
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
CALL python_triple(5, 10);
|
||||
</programlisting>
|
||||
</para>
|
||||
</sect2>
|
||||
|
Reference in New Issue
Block a user