diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-07-07 11:17:04 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-07-07 11:21:20 +0200 |
commit | e8137295b3fe8a38a579b402512a4442bc992250 (patch) | |
tree | 788bfbdd4b821f5a3a6709ad6273b8f8a29248be /src/backend/parser/parse_func.c | |
parent | 0e4a46670e3a731eae177d8fa961f97b89298922 (diff) |
Add separate error message for procedure does not exist
While we probably don't want to split up all error messages into
function and procedure variants, this one is a very prominent one, so
it's helpful to be more specific here.
Diffstat (limited to 'src/backend/parser/parse_func.c')
-rw-r--r-- | src/backend/parser/parse_func.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index abe1dbc521c..c2feaf371fe 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -542,14 +542,24 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, if (is_column) return NULL; - ereport(ERROR, - (errcode(ERRCODE_AMBIGUOUS_FUNCTION), - errmsg("function %s is not unique", - func_signature_string(funcname, nargs, argnames, - actual_arg_types)), - errhint("Could not choose a best candidate function. " - "You might need to add explicit type casts."), - parser_errposition(pstate, location))); + if (proc_call) + ereport(ERROR, + (errcode(ERRCODE_AMBIGUOUS_FUNCTION), + errmsg("procedure %s is not unique", + func_signature_string(funcname, nargs, argnames, + actual_arg_types)), + errhint("Could not choose a best candidate procedure. " + "You might need to add explicit type casts."), + parser_errposition(pstate, location))); + else + ereport(ERROR, + (errcode(ERRCODE_AMBIGUOUS_FUNCTION), + errmsg("function %s is not unique", + func_signature_string(funcname, nargs, argnames, + actual_arg_types)), + errhint("Could not choose a best candidate function. " + "You might need to add explicit type casts."), + parser_errposition(pstate, location))); } else { @@ -591,6 +601,15 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, "after all regular arguments of the aggregate."), parser_errposition(pstate, location))); } + else if (proc_call) + ereport(ERROR, + (errcode(ERRCODE_UNDEFINED_FUNCTION), + errmsg("procedure %s does not exist", + func_signature_string(funcname, nargs, argnames, + actual_arg_types)), + errhint("No procedure matches the given name and argument types. " + "You might need to add explicit type casts."), + parser_errposition(pstate, location))); else ereport(ERROR, (errcode(ERRCODE_UNDEFINED_FUNCTION), |