Support INOUT arguments in procedures

Enterprise / PostgreSQL - Peter Eisentraut [gmx.net] - 14 March 2018 16:07 EDT

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.

33803f67f1 Support INOUT arguments in procedures
doc/src/sgml/plperl.sgml | 14 +++
doc/src/sgml/plpgsql.sgml | 16 +++
doc/src/sgml/plpython.sgml | 11 ++
doc/src/sgml/pltcl.sgml | 12 ++
doc/src/sgml/ref/call.sgml | 4 +
doc/src/sgml/ref/create_procedure.sgml | 7 +-
src/backend/catalog/pg_proc.c | 4 +-
src/backend/commands/functioncmds.c | 65 +++++++++--
src/backend/executor/functions.c | 51 +++++++++
src/backend/tcop/utility.c | 3 +-
src/backend/utils/fmgr/funcapi.c | 11 +-
src/include/commands/defrem.h | 3 +-
src/include/executor/functions.h | 2 +
src/include/funcapi.h | 3 +-
src/pl/plperl/expected/plperl_call.out | 25 +++++
src/pl/plperl/sql/plperl_call.sql | 22 ++++
src/pl/plpgsql/src/expected/plpgsql_call.out | 112 ++++++++++++++++++
.../plpgsql/src/expected/plpgsql_transaction.out | 2 +-
src/pl/plpgsql/src/pl_comp.c | 10 +-
src/pl/plpgsql/src/pl_exec.c | 125 ++++++++++++++++++++-
src/pl/plpgsql/src/pl_funcs.c | 25 +++++
src/pl/plpgsql/src/pl_gram.y | 37 ++++--
src/pl/plpgsql/src/pl_scanner.c | 1 +
src/pl/plpgsql/src/plpgsql.h | 12 ++
src/pl/plpgsql/src/sql/plpgsql_call.sql | 107 ++++++++++++++++++
src/pl/plpython/expected/plpython_call.out | 23 ++++
src/pl/plpython/plpy_exec.c | 24 ++--
src/pl/plpython/sql/plpython_call.sql | 20 ++++
src/pl/tcl/expected/pltcl_call.out | 26 +++++
src/pl/tcl/sql/pltcl_call.sql | 23 ++++
src/test/regress/expected/create_procedure.out | 23 +++-
src/test/regress/sql/create_procedure.sql | 19 ++++
32 files changed, 792 insertions(+), 50 deletions(-)

Upstream: git.postgresql.org


  • Share