From 8a56d4e361d4566ce5d6b55f25c3f23aa44f4741 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 8 Aug 2016 08:15:41 -0400 Subject: [PATCH] Make format() error messages consistent again 07d25a964 changed only one occurrence. Change the other one as well. --- src/backend/utils/adt/varlena.c | 2 +- src/test/regress/expected/text.out | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index a869e858bc..bf7c0cd735 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -5004,7 +5004,7 @@ text_format(PG_FUNCTION_ARGS) if (arg >= nargs) ereport(ERROR, (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 */ if (!funcvariadic) diff --git a/src/test/regress/expected/text.out b/src/test/regress/expected/text.out index a74b9cebd6..829f2c224c 100644 --- a/src/test/regress/expected/text.out +++ b/src/test/regress/expected/text.out @@ -207,9 +207,9 @@ select format('Hello %%%%'); -- should fail select format('Hello %s %s', 'World'); -ERROR: too few arguments for format +ERROR: too few arguments for format() select format('Hello %s'); -ERROR: too few arguments for format +ERROR: too few arguments for format() select format('Hello %x', 20); ERROR: unrecognized format() type specifier "x" 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 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); -ERROR: too few arguments for format +ERROR: too few arguments for format() select format('%0$s', 'Hello'); ERROR: format specifies argument 0, but arguments are numbered from 1 select format('%*0$s', 'Hello'); -- 2.40.0