aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-03-05 11:51:15 -0500
committerPeter Eisentraut <peter_e@gmx.net>2018-03-05 11:51:15 -0500
commit09230e54fb39e8cd8add3f119d03afd72adc72b9 (patch)
tree578a09eafb7a1e7f6f02205e4f83d373387e27d3
parentdd9ed0bf7039eb2b97d9afa198409c0e9798f4ac (diff)
downloadpostgresql-09230e54fb39e8cd8add3f119d03afd72adc72b9.tar.gz
postgresql-09230e54fb39e8cd8add3f119d03afd72adc72b9.zip
Remove some obsolete procedure-specific code from PLs
Since procedures are now declared to return void, code that handled return values for procedures separately is no longer necessary.
-rw-r--r--src/pl/plperl/plperl.c3
-rw-r--r--src/pl/plpython/plpy_procedure.c4
-rw-r--r--src/pl/tcl/pltcl.c13
3 files changed, 7 insertions, 13 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index fa8e2fdc695..d44089aedcc 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -2832,8 +2832,7 @@ compile_plperl_function(Oid fn_oid, bool is_trigger, bool is_event_trigger)
* Get the required information for input conversion of the
* return value.
************************************************************/
- if (!is_trigger && !is_event_trigger &&
- procStruct->prokind != PROKIND_PROCEDURE)
+ if (!is_trigger && !is_event_trigger)
{
Oid rettype = procStruct->prorettype;
diff --git a/src/pl/plpython/plpy_procedure.c b/src/pl/plpython/plpy_procedure.c
index 82cc3f28b8d..b4c4dcdb6c2 100644
--- a/src/pl/plpython/plpy_procedure.c
+++ b/src/pl/plpython/plpy_procedure.c
@@ -206,9 +206,9 @@ PLy_procedure_create(HeapTuple procTup, Oid fn_oid, bool is_trigger)
/*
* get information required for output conversion of the return value,
- * but only if this isn't a trigger or procedure.
+ * but only if this isn't a trigger.
*/
- if (!is_trigger && procStruct->prokind != PROKIND_PROCEDURE)
+ if (!is_trigger)
{
Oid rettype = procStruct->prorettype;
HeapTuple rvTypeTup;
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index 2eb6c337aae..11411f35ab3 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -146,7 +146,6 @@ typedef struct pltcl_proc_desc
Oid result_typid; /* OID of fn's result type */
FmgrInfo result_in_func; /* input function for fn's result type */
Oid result_typioparam; /* param to pass to same */
- bool fn_is_procedure; /* true if this is a procedure */
bool fn_retisset; /* true if function returns a set */
bool fn_retistuple; /* true if function returns composite */
bool fn_retisdomain; /* true if function returns domain */
@@ -982,7 +981,7 @@ pltcl_func_handler(PG_FUNCTION_ARGS, pltcl_call_state *call_state,
retval = (Datum) 0;
fcinfo->isnull = true;
}
- else if (fcinfo->isnull && !prodesc->fn_is_procedure)
+ else if (fcinfo->isnull)
{
retval = InputFunctionCall(&prodesc->result_in_func,
NULL,
@@ -1040,13 +1039,11 @@ pltcl_func_handler(PG_FUNCTION_ARGS, pltcl_call_state *call_state,
call_state);
retval = HeapTupleGetDatum(tup);
}
- else if (!prodesc->fn_is_procedure)
+ else
retval = InputFunctionCall(&prodesc->result_in_func,
utf_u2e(Tcl_GetStringResult(interp)),
prodesc->result_typioparam,
-1);
- else
- retval = 0;
return retval;
}
@@ -1523,9 +1520,7 @@ compile_pltcl_function(Oid fn_oid, Oid tgreloid,
* Get the required information for input conversion of the
* return value.
************************************************************/
- prodesc->fn_is_procedure = (procStruct->prokind == PROKIND_PROCEDURE);
-
- if (!is_trigger && !is_event_trigger && !prodesc->fn_is_procedure)
+ if (!is_trigger && !is_event_trigger)
{
Oid rettype = procStruct->prorettype;
@@ -2218,7 +2213,7 @@ pltcl_returnnext(ClientData cdata, Tcl_Interp *interp,
tuplestore_puttuple(call_state->tuple_store, tuple);
}
}
- else if (!prodesc->fn_is_procedure)
+ else
{
Datum retval;
bool isNull = false;