1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Add errhint_plural() function and make use of it

Similar to existing errmsg_plural() and errdetail_plural().  Some
errhint() calls hadn't received the proper plural treatment yet.
This commit is contained in:
Peter Eisentraut
2021-03-31 09:15:51 +02:00
parent 287d2a97c1
commit 91c5a8caaa
5 changed files with 51 additions and 11 deletions

View File

@ -417,9 +417,11 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
func_signature_string(funcname, nargs,
argnames,
actual_arg_types)),
errhint("There is an ordered-set aggregate %s, but it requires %d direct arguments, not %d.",
NameListToString(funcname),
catDirectArgs, numDirectArgs),
errhint_plural("There is an ordered-set aggregate %s, but it requires %d direct argument, not %d.",
"There is an ordered-set aggregate %s, but it requires %d direct arguments, not %d.",
catDirectArgs,
NameListToString(funcname),
catDirectArgs, numDirectArgs),
parser_errposition(pstate, location)));
}
else
@ -446,9 +448,11 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
func_signature_string(funcname, nargs,
argnames,
actual_arg_types)),
errhint("There is an ordered-set aggregate %s, but it requires %d direct arguments, not %d.",
NameListToString(funcname),
catDirectArgs, numDirectArgs),
errhint_plural("There is an ordered-set aggregate %s, but it requires %d direct argument, not %d.",
"There is an ordered-set aggregate %s, but it requires %d direct arguments, not %d.",
catDirectArgs,
NameListToString(funcname),
catDirectArgs, numDirectArgs),
parser_errposition(pstate, location)));
}
else
@ -485,9 +489,11 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
func_signature_string(funcname, nargs,
argnames,
actual_arg_types)),
errhint("There is an ordered-set aggregate %s, but it requires at least %d direct arguments.",
NameListToString(funcname),
catDirectArgs),
errhint_plural("There is an ordered-set aggregate %s, but it requires at least %d direct argument.",
"There is an ordered-set aggregate %s, but it requires at least %d direct arguments.",
catDirectArgs,
NameListToString(funcname),
catDirectArgs),
parser_errposition(pstate, location)));
}
}