diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 8487edaa958..25ae4e59490 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -1950,9 +1950,10 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError) errmsg("function name \"%s\" is not unique", NameListToString(funcname)), errhint("Specify the argument list to select the function unambiguously."))); + return InvalidOid; } - else - return clist->oid; + /* Otherwise return the match */ + return clist->oid; } else { @@ -1961,9 +1962,14 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError) (errcode(ERRCODE_UNDEFINED_FUNCTION), errmsg("could not find a function named \"%s\"", NameListToString(funcname)))); + return InvalidOid; } } + /* + * Otherwise, look for a match to the arg types. FuncnameGetCandidates + * has ensured that there's at most one match in the returned list. + */ while (clist) { if (memcmp(argtypes, clist->args, nargs * sizeof(Oid)) == 0)