Hello.

I noticed that some error messages have issues such as non-standard
wording, slightly odd output, and minor grammatical mistakes, and have
attached patches addressing each of the items below.

0001:
guc_table.c:
>               .name = "effective_wal_level",
>...
>               .short_desc = gettext_noop("Show effective WAL level."),

We use "shows" in that context.


0002:
partbounds.c:
> errhint("ALTER TABLE ... MERGE PARTITIONS requires the partition bounds to be 
> adjacent."),
...
> errhint("ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be 
> adjacent."),

These messages share the same body only differ in the command name. On
the other hand we have the following message in the same file.

> errhint("%s require combined bounds of new partitions must exactly match the 
> bound of the split partition",
>                                       "ALTER TABLE ... SPLIT PARTITION"),

So, I think that the first two messages shoud use the same structure
with the last one.


0003:

The last message above mistakenly uses the present tense, and some
other messages do the same. I think this should be fixed.


0004:

In the messages mentioned in 0002, the sentence structure is somewhat
hard to parse. Adding “that” after “requires” should improve clarity,
as in several other messages with the same issue.


0005:

In wait.c, there are three error messages with inconsistent wording:
two use "timeout value", while one uses "timeout" to refer to the same
object. This makes translation slightly awkward, so I suggest unifying
the wording.


0006: 
In extended_stats_funcs.c:
> errmsg("could not find extended statistics object \"%s\".\"%s\"",
>        quote_identifier(nspname),
>        quote_identifier(stxname)));

Since quote_identifier() already adds quoting when needed, adding
"%s"."%s" in the format string results in double quoting. It would be
better to use %s.%s instead.  I think quoting should be applied only
when necessary here. I'm not sure we should use
quote_qualified_identifier() instead.. (It's not used in the attached
patch).

There's a similar inconsistency.

>       errmsg("could not clear extended statistics object \"%s\".\"%s\": 
> incorrect relation \"%s\".\"%s\" specified",
>                  get_namespace_name(nspoid), stxname,
>                  relnspname, relname));

In this part, the names are not passed through quote_identifier().  It
would be better to unify this as well.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center
>From b2315b812b3ed5274a49bcaeeffe9e343cbd5a19 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <[email protected]>
Date: Thu, 5 Feb 2026 13:09:00 +0900
Subject: [PATCH 1/6] =?UTF-8?q?Use=20third-person=20singular=20=E2=80=9CSh?=
 =?UTF-8?q?ows=E2=80=9D=20for=20reporting=20variable?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Align with the convention of using third-person singular “Shows” in a
reporting variable description.
---
 src/backend/utils/misc/guc_parameters.dat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/utils/misc/guc_parameters.dat b/src/backend/utils/misc/guc_parameters.dat
index 762b8efe6b0..1031c7dbe80 100644
--- a/src/backend/utils/misc/guc_parameters.dat
+++ b/src/backend/utils/misc/guc_parameters.dat
@@ -806,7 +806,7 @@
 },
 
 { name => 'effective_wal_level', type => 'enum', context => 'PGC_INTERNAL', group => 'PRESET_OPTIONS',
-  short_desc => 'Show effective WAL level.',
+  short_desc => 'Shows effective WAL level.',
   flags => 'GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE',
   variable => 'effective_wal_level',
   boot_val => 'WAL_LEVEL_REPLICA',
-- 
2.47.3

>From cab8e36ef5ec98b0988b5b0115570fee61dec7b8 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <[email protected]>
Date: Thu, 5 Feb 2026 13:17:58 +0900
Subject: [PATCH 2/6] Consolidate target-only message variants

Consolidate two messages that differ only in their targets into a
single translation unit.
---
 src/backend/partitioning/partbounds.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 0ca312ac27d..d8f48cb0868 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -5033,7 +5033,8 @@ check_two_partitions_bounds_range(Relation parent,
 						   second_name->relname, first_name->relname),
 					errdetail("lower bound of partition \"%s\" is not equal to the upper bound of partition \"%s\"",
 							  second_name->relname, first_name->relname),
-					errhint("ALTER TABLE ... MERGE PARTITIONS requires the partition bounds to be adjacent."),
+					errhint("%s requires the partition bounds to be adjacent.",
+							"ALTER TABLE ... MERGE PARTITIONS"),
 					parser_errposition(pstate, datum->location));
 		else
 			ereport(ERROR,
@@ -5042,7 +5043,8 @@ check_two_partitions_bounds_range(Relation parent,
 						   second_name->relname, first_name->relname),
 					errdetail("lower bound of partition \"%s\" is not equal to the upper bound of partition \"%s\"",
 							  second_name->relname, first_name->relname),
-					errhint("ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent."),
+					errhint("%s requires the partition bounds to be adjacent.",
+							"ALTER TABLE ... SPLIT PARTITION"),
 					parser_errposition(pstate, datum->location));
 	}
 }
-- 
2.47.3

From dc2214e460b19a105c2858362a8daa653ce38b17 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <[email protected]>
Date: Tue, 10 Feb 2026 13:46:17 +0900
Subject: [PATCH 3/6] Fix grammar in a partition-related message
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix subject–verb agreement.
---
 src/backend/partitioning/partbounds.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index d8f48cb0868..a4487521a67 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -5406,7 +5406,7 @@ check_partition_bounds_for_split_range(Relation parent,
 							errmsg("lower bound of partition \"%s\" is not equal to lower bound of split partition \"%s\"",
 								   relname,
 								   get_rel_name(splitPartOid)),
-							errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition",
+							errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
 									"ALTER TABLE ... SPLIT PARTITION"),
 							parser_errposition(pstate, exprLocation((Node *) datum)));
 			}
@@ -5416,7 +5416,7 @@ check_partition_bounds_for_split_range(Relation parent,
 						errmsg("lower bound of partition \"%s\" is less than lower bound of split partition \"%s\"",
 							   relname,
 							   get_rel_name(splitPartOid)),
-						errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition",
+						errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
 								"ALTER TABLE ... SPLIT PARTITION"),
 						parser_errposition(pstate, exprLocation((Node *) datum)));
 		}
@@ -5448,7 +5448,7 @@ check_partition_bounds_for_split_range(Relation parent,
 							errmsg("upper bound of partition \"%s\" is not equal to upper bound of split partition \"%s\"",
 								   relname,
 								   get_rel_name(splitPartOid)),
-							errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition",
+							errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
 									"ALTER TABLE ... SPLIT PARTITION"),
 							parser_errposition(pstate, exprLocation((Node *) datum)));
 			}
@@ -5458,7 +5458,7 @@ check_partition_bounds_for_split_range(Relation parent,
 						errmsg("upper bound of partition \"%s\" is greater than upper bound of split partition \"%s\"",
 							   relname,
 							   get_rel_name(splitPartOid)),
-						errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition",
+						errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
 								"ALTER TABLE ... SPLIT PARTITION"),
 						parser_errposition(pstate, exprLocation((Node *) datum)));
 		}
@@ -5654,7 +5654,7 @@ check_parent_values_in_new_partitions(Relation parent,
 				errmsg("new partitions combined partition bounds do not contain value (%s) but split partition \"%s\" does",
 					   "NULL",
 					   get_rel_name(partOid)),
-				errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition",
+				errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
 						"ALTER TABLE ... SPLIT PARTITION"));
 
 	/*
@@ -5697,7 +5697,7 @@ check_parent_values_in_new_partitions(Relation parent,
 				errmsg("new partitions combined partition bounds do not contain value (%s) but split partition \"%s\" does",
 					   deparse_expression((Node *) notFoundVal, NIL, false, false),
 					   get_rel_name(partOid)),
-				errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition",
+				errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
 						"ALTER TABLE ... SPLIT PARTITION"));
 	}
 }
-- 
2.47.3

>From 7a3524600fa589565b0cc4b5f00196d60213dff6 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <[email protected]>
Date: Tue, 10 Feb 2026 13:48:25 +0900
Subject: [PATCH 4/6] Add omitted "that" for clarity in some messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch inserts “that” in several message where it had been
omitted, improving readability and reducing ambiguity.
---
 src/backend/partitioning/partbounds.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index a4487521a67..be3a3dc80f0 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -5406,7 +5406,7 @@ check_partition_bounds_for_split_range(Relation parent,
 							errmsg("lower bound of partition \"%s\" is not equal to lower bound of split partition \"%s\"",
 								   relname,
 								   get_rel_name(splitPartOid)),
-							errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
+							errhint("%s requires that combined bounds of new partitions must exactly match the bound of the split partition",
 									"ALTER TABLE ... SPLIT PARTITION"),
 							parser_errposition(pstate, exprLocation((Node *) datum)));
 			}
@@ -5416,7 +5416,7 @@ check_partition_bounds_for_split_range(Relation parent,
 						errmsg("lower bound of partition \"%s\" is less than lower bound of split partition \"%s\"",
 							   relname,
 							   get_rel_name(splitPartOid)),
-						errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
+						errhint("%s requires that combined bounds of new partitions must exactly match the bound of the split partition",
 								"ALTER TABLE ... SPLIT PARTITION"),
 						parser_errposition(pstate, exprLocation((Node *) datum)));
 		}
@@ -5448,7 +5448,7 @@ check_partition_bounds_for_split_range(Relation parent,
 							errmsg("upper bound of partition \"%s\" is not equal to upper bound of split partition \"%s\"",
 								   relname,
 								   get_rel_name(splitPartOid)),
-							errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
+							errhint("%s requires that combined bounds of new partitions must exactly match the bound of the split partition",
 									"ALTER TABLE ... SPLIT PARTITION"),
 							parser_errposition(pstate, exprLocation((Node *) datum)));
 			}
@@ -5458,7 +5458,7 @@ check_partition_bounds_for_split_range(Relation parent,
 						errmsg("upper bound of partition \"%s\" is greater than upper bound of split partition \"%s\"",
 							   relname,
 							   get_rel_name(splitPartOid)),
-						errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
+						errhint("%s requires that combined bounds of new partitions must exactly match the bound of the split partition",
 								"ALTER TABLE ... SPLIT PARTITION"),
 						parser_errposition(pstate, exprLocation((Node *) datum)));
 		}
@@ -5654,7 +5654,7 @@ check_parent_values_in_new_partitions(Relation parent,
 				errmsg("new partitions combined partition bounds do not contain value (%s) but split partition \"%s\" does",
 					   "NULL",
 					   get_rel_name(partOid)),
-				errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
+				errhint("%s requires that combined bounds of new partitions must exactly match the bound of the split partition",
 						"ALTER TABLE ... SPLIT PARTITION"));
 
 	/*
@@ -5697,7 +5697,7 @@ check_parent_values_in_new_partitions(Relation parent,
 				errmsg("new partitions combined partition bounds do not contain value (%s) but split partition \"%s\" does",
 					   deparse_expression((Node *) notFoundVal, NIL, false, false),
 					   get_rel_name(partOid)),
-				errhint("%s requires combined bounds of new partitions must exactly match the bound of the split partition",
+				errhint("%s requires that combined bounds of new partitions must exactly match the bound of the split partition",
 						"ALTER TABLE ... SPLIT PARTITION"));
 	}
 }
-- 
2.47.3

>From 945b925964407c5f7527d0d942862d83fba63fbf Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <[email protected]>
Date: Thu, 5 Feb 2026 16:55:21 +0900
Subject: [PATCH 5/6] Unify wording of timeout error messages

Align the wording of timeout-related error messages by using
"timeout value" consistently.
---
 src/backend/commands/wait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/wait.c b/src/backend/commands/wait.c
index 1290df10c6f..5218ce4c7fe 100644
--- a/src/backend/commands/wait.c
+++ b/src/backend/commands/wait.c
@@ -111,7 +111,7 @@ ExecWaitStmt(ParseState *pstate, WaitStmt *stmt, DestReceiver *dest)
 			if (result < 0)
 				ereport(ERROR,
 						errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-						errmsg("timeout cannot be negative"));
+						errmsg("timeout value cannot be negative"));
 
 			timeout = (int64) result;
 		}
-- 
2.47.3

>From b78d758fb6d44aa4a5e99f9a6250cd8c57c1fe16 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <[email protected]>
Date: Mon, 9 Feb 2026 16:16:06 +0900
Subject: [PATCH 6/6] Fix double quoting in extended statistics error message

Remove extra quoting for identifiers already quoted by
quote_identifier().
---
 src/backend/statistics/extended_stats_funcs.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/backend/statistics/extended_stats_funcs.c b/src/backend/statistics/extended_stats_funcs.c
index b640941a9cc..c718ffa95c6 100644
--- a/src/backend/statistics/extended_stats_funcs.c
+++ b/src/backend/statistics/extended_stats_funcs.c
@@ -347,7 +347,7 @@ extended_statistics_update(FunctionCallInfo fcinfo)
 	{
 		ereport(WARNING,
 				errcode(ERRCODE_UNDEFINED_OBJECT),
-				errmsg("could not find extended statistics object \"%s\".\"%s\"",
+				errmsg("could not find extended statistics object %s.%s",
 					   quote_identifier(nspname),
 					   quote_identifier(stxname)));
 		success = false;
@@ -420,7 +420,7 @@ extended_statistics_update(FunctionCallInfo fcinfo)
 				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
 				errmsg("cannot specify parameter \"%s\"",
 					   extarginfo[NDISTINCT_ARG].argname),
-				errhint("Extended statistics object \"%s\".\"%s\" does not support statistics of this type.",
+				errhint("Extended statistics object %s.%s does not support statistics of this type.",
 						quote_identifier(nspname),
 						quote_identifier(stxname)));
 
@@ -904,9 +904,11 @@ pg_clear_extended_stats(PG_FUNCTION_ARGS)
 		table_close(pg_stext, RowExclusiveLock);
 		ereport(WARNING,
 				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				errmsg("could not clear extended statistics object \"%s\".\"%s\": incorrect relation \"%s\".\"%s\" specified",
-					   get_namespace_name(nspoid), stxname,
-					   relnspname, relname));
+				errmsg("could not clear extended statistics object %s.%s: incorrect relation %s.%s specified",
+					   quote_identifier(get_namespace_name(nspoid)),
+					   quote_identifier(stxname),
+					   quote_identifier(relnspname),
+					   quote_identifier(relname)));
 		PG_RETURN_VOID();
 	}
 
-- 
2.47.3

Reply via email to