diff options
author | Peter Eisentraut | 2018-03-14 15:47:21 +0000 |
---|---|---|
committer | Peter Eisentraut | 2018-03-14 16:07:28 +0000 |
commit | 33803f67f1c4cb88733cce61207bbf2bd5b599cc (patch) | |
tree | 9ec962aebf50eb4b16a585f83f490d9a5aa6f677 /src/include | |
parent | 484a4a08abe316212d67d84bb8705b06e44f862d (diff) |
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>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/commands/defrem.h | 3 | ||||
-rw-r--r-- | src/include/executor/functions.h | 2 | ||||
-rw-r--r-- | src/include/funcapi.h | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index c829abfea7e..8fc9e424cfc 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -17,6 +17,7 @@ #include "catalog/objectaddress.h" #include "nodes/params.h" #include "nodes/parsenodes.h" +#include "tcop/dest.h" #include "utils/array.h" /* commands/dropcmds.c */ @@ -62,7 +63,7 @@ extern void DropTransformById(Oid transformOid); extern void IsThereFunctionInNamespace(const char *proname, int pronargs, oidvector *proargtypes, Oid nspOid); extern void ExecuteDoStmt(DoStmt *stmt, bool atomic); -extern void ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic); +extern void ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver *dest); extern Oid get_cast_oid(Oid sourcetypeid, Oid targettypeid, bool missing_ok); extern Oid get_transform_oid(Oid type_id, Oid lang_id, bool missing_ok); extern void interpret_function_parameter_list(ParseState *pstate, diff --git a/src/include/executor/functions.h b/src/include/executor/functions.h index e7454ee7906..a309809ba84 100644 --- a/src/include/executor/functions.h +++ b/src/include/executor/functions.h @@ -29,6 +29,8 @@ extern SQLFunctionParseInfoPtr prepare_sql_fn_parse_info(HeapTuple procedureTupl extern void sql_fn_parser_setup(struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo); +extern void check_sql_fn_statements(List *queryTreeList); + extern bool check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList, bool *modifyTargetList, diff --git a/src/include/funcapi.h b/src/include/funcapi.h index c2da2eb1579..01aa208c5ee 100644 --- a/src/include/funcapi.h +++ b/src/include/funcapi.h @@ -187,7 +187,8 @@ extern int get_func_input_arg_names(Datum proargnames, Datum proargmodes, extern int get_func_trftypes(HeapTuple procTup, Oid **p_trftypes); extern char *get_func_result_name(Oid functionId); -extern TupleDesc build_function_result_tupdesc_d(Datum proallargtypes, +extern TupleDesc build_function_result_tupdesc_d(char prokind, + Datum proallargtypes, Datum proargmodes, Datum proargnames); extern TupleDesc build_function_result_tupdesc_t(HeapTuple procTuple); |