mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Make format() error messages consistent again
07d25a964 changed only one occurrence. Change the other one as well.
This commit is contained in:
parent
be7f7ee5ea
commit
8a56d4e361
@ -5004,7 +5004,7 @@ text_format(PG_FUNCTION_ARGS)
|
|||||||
if (arg >= nargs)
|
if (arg >= nargs)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||||
errmsg("too few arguments for format")));
|
errmsg("too few arguments for format()")));
|
||||||
|
|
||||||
/* Get the value and type of the selected argument */
|
/* Get the value and type of the selected argument */
|
||||||
if (!funcvariadic)
|
if (!funcvariadic)
|
||||||
|
@ -207,9 +207,9 @@ select format('Hello %%%%');
|
|||||||
|
|
||||||
-- should fail
|
-- should fail
|
||||||
select format('Hello %s %s', 'World');
|
select format('Hello %s %s', 'World');
|
||||||
ERROR: too few arguments for format
|
ERROR: too few arguments for format()
|
||||||
select format('Hello %s');
|
select format('Hello %s');
|
||||||
ERROR: too few arguments for format
|
ERROR: too few arguments for format()
|
||||||
select format('Hello %x', 20);
|
select format('Hello %x', 20);
|
||||||
ERROR: unrecognized format() type specifier "x"
|
ERROR: unrecognized format() type specifier "x"
|
||||||
HINT: For a single "%" use "%%".
|
HINT: For a single "%" use "%%".
|
||||||
@ -256,9 +256,9 @@ select format('%1$s %12$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
|||||||
|
|
||||||
-- should fail
|
-- should fail
|
||||||
select format('%1$s %4$s', 1, 2, 3);
|
select format('%1$s %4$s', 1, 2, 3);
|
||||||
ERROR: too few arguments for format
|
ERROR: too few arguments for format()
|
||||||
select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
||||||
ERROR: too few arguments for format
|
ERROR: too few arguments for format()
|
||||||
select format('%0$s', 'Hello');
|
select format('%0$s', 'Hello');
|
||||||
ERROR: format specifies argument 0, but arguments are numbered from 1
|
ERROR: format specifies argument 0, but arguments are numbered from 1
|
||||||
select format('%*0$s', 'Hello');
|
select format('%*0$s', 'Hello');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user