Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a56d4e

Browse files
committed
Make format() error messages consistent again
07d25a9 changed only one occurrence. Change the other one as well.
1 parentbe7f7ee commit8a56d4e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/backend/utils/adt/varlena.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5004,7 +5004,7 @@ text_format(PG_FUNCTION_ARGS)
50045004
if (arg >=nargs)
50055005
ereport(ERROR,
50065006
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
5007-
errmsg("too few arguments for format")));
5007+
errmsg("too few arguments for format()")));
50085008

50095009
/* Get the value and type of the selected argument */
50105010
if (!funcvariadic)

‎src/test/regress/expected/text.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ select format('Hello %%%%');
207207

208208
-- should fail
209209
select format('Hello %s %s', 'World');
210-
ERROR: too few arguments for format
210+
ERROR: too few arguments for format()
211211
select format('Hello %s');
212-
ERROR: too few arguments for format
212+
ERROR: too few arguments for format()
213213
select format('Hello %x', 20);
214214
ERROR: unrecognized format() type specifier "x"
215215
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);
256256

257257
-- should fail
258258
select format('%1$s %4$s', 1, 2, 3);
259-
ERROR: too few arguments for format
259+
ERROR: too few arguments for format()
260260
select format('%1$s %13$s', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
261-
ERROR: too few arguments for format
261+
ERROR: too few arguments for format()
262262
select format('%0$s', 'Hello');
263263
ERROR: format specifies argument 0, but arguments are numbered from 1
264264
select format('%*0$s', 'Hello');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp