diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index dc437aae49..f45ba8a8f2 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -1998,52 +1998,6 @@ InputFunctionCall(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod) return result; } -Datum -InputFunctionCallSafe(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext) -{ - FunctionCallInfoData fcinfo; - Datum result; - bool pushed; - - if (str == NULL && flinfo->fn_strict) - return (Datum) 0; /* just return null result */ - - pushed = SPI_push_conditional(); - - InitFunctionCallInfoData(fcinfo, flinfo, 3, InvalidOid, escontext, NULL); - - fcinfo.arg[0] = CStringGetDatum(str); - fcinfo.arg[1] = ObjectIdGetDatum(typioparam); - fcinfo.arg[2] = Int32GetDatum(typmod); - fcinfo.argnull[0] = (str == NULL); - fcinfo.argnull[1] = false; - fcinfo.argnull[2] = false; - - result = FunctionCallInvoke(&fcinfo); - - /* Result value is garbage, and could be null, if an error was reported */ - if (SOFT_ERROR_OCCURRED(escontext)) - return (Datum) 0; - - /* Should get null result if and only if str is NULL */ - if (str == NULL) - { - if (!fcinfo.isnull) - elog(ERROR, "input function %u returned non-NULL", - fcinfo.flinfo->fn_oid); - } - else - { - if (fcinfo.isnull) - elog(ERROR, "input function %u returned NULL", - fcinfo.flinfo->fn_oid); - } - - SPI_pop_conditional(pushed); - - return result; -} - /* * Call a previously-looked-up datatype input function, with non-exception * handling of "soft" errors.