mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-24 02:37:18 +02:00
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.
This commit is contained in:
parent
0e4a46670e
commit
e8137295b3
@ -542,14 +542,24 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
|||||||
if (is_column)
|
if (is_column)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ereport(ERROR,
|
if (proc_call)
|
||||||
(errcode(ERRCODE_AMBIGUOUS_FUNCTION),
|
ereport(ERROR,
|
||||||
errmsg("function %s is not unique",
|
(errcode(ERRCODE_AMBIGUOUS_FUNCTION),
|
||||||
func_signature_string(funcname, nargs, argnames,
|
errmsg("procedure %s is not unique",
|
||||||
actual_arg_types)),
|
func_signature_string(funcname, nargs, argnames,
|
||||||
errhint("Could not choose a best candidate function. "
|
actual_arg_types)),
|
||||||
"You might need to add explicit type casts."),
|
errhint("Could not choose a best candidate procedure. "
|
||||||
parser_errposition(pstate, location)));
|
"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
|
else
|
||||||
{
|
{
|
||||||
@ -591,6 +601,15 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
|||||||
"after all regular arguments of the aggregate."),
|
"after all regular arguments of the aggregate."),
|
||||||
parser_errposition(pstate, location)));
|
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
|
else
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
CALL nonexistent(); -- error
|
CALL nonexistent(); -- error
|
||||||
ERROR: function nonexistent() does not exist
|
ERROR: procedure nonexistent() does not exist
|
||||||
LINE 1: CALL nonexistent();
|
LINE 1: CALL nonexistent();
|
||||||
^
|
^
|
||||||
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
|
HINT: No procedure matches the given name and argument types. You might need to add explicit type casts.
|
||||||
CALL random(); -- error
|
CALL random(); -- error
|
||||||
ERROR: random() is not a procedure
|
ERROR: random() is not a procedure
|
||||||
LINE 1: CALL random();
|
LINE 1: CALL random();
|
||||||
|
Loading…
Reference in New Issue
Block a user