aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/parse_func.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 44257154b81..141007d5a4b 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -2059,9 +2059,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
{
@@ -2070,9 +2071,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)