postgres.git / summary / log / commit / refs
commit ba7f9d95e6a0a4c01b18a07bebbeb487256a7ad3
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Thu Sep 03 09:49:09 2026 +0000
Fix lack of message pluralization
Fixups for commits b99b74144f9, 79b101486c1, bf7d19be9b1.
src/backend/commands/trigger.c | 6 ++++--
src/backend/replication/logical/worker.c | 18 ++++++++++++------
src/backend/utils/time/snapmgr.c | 17 +++++++++++++----
3 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index eaa136b0444..c3ad45353d7 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -897,8 +897,10 @@ CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString,
if (nargs > PG_INT16_MAX)
ereport(ERROR,
errcode(ERRCODE_TOO_MANY_ARGUMENTS),
- errmsg("triggers cannot have more than %d arguments",
- PG_INT16_MAX));
+ errmsg_plural("triggers cannot have more than %d argument",
+ "triggers cannot have more than %d arguments",
+ PG_INT16_MAX,
+ PG_INT16_MAX));
foreach(le, stmt->args)
{
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 321fc1e7ee1..6337bc42d7b 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -639,8 +639,10 @@ slot_store_data(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
if (remoteattnum >= tupleData->ncols)
ereport(ERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("logical replication column %d not found in tuple: only %d column(s) received",
- remoteattnum + 1, tupleData->ncols)));
+ errmsg_plural("logical replication column %d not found in tuple: only %d column received",
+ "logical replication column %d not found in tuple: only %d columns received",
+ tupleData->ncols,
+ remoteattnum + 1, tupleData->ncols)));
colvalue = &tupleData->colvalues[remoteattnum];
@@ -756,8 +758,10 @@ slot_modify_data(TupleTableSlot *slot, TupleTableSlot *srcslot,
if (remoteattnum >= tupleData->ncols)
ereport(ERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("logical replication column %d not found in tuple: only %d column(s) received",
- remoteattnum + 1, tupleData->ncols)));
+ errmsg_plural("logical replication column %d not found in tuple: only %d column received",
+ "logical replication column %d not found in tuple: only %d columns received",
+ tupleData->ncols,
+ remoteattnum + 1, tupleData->ncols)));
if (tupleData->colstatus[remoteattnum] != LOGICALREP_COLUMN_UNCHANGED)
{
@@ -1861,8 +1865,10 @@ apply_handle_update(StringInfo s)
if (remoteattnum >= newtup.ncols)
ereport(ERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
- errmsg("logical replication column %d not found in tuple: only %d column(s) received",
- remoteattnum + 1, newtup.ncols)));
+ errmsg_plural("logical replication column %d not found in tuple: only %d column received",
+ "logical replication column %d not found in tuple: only %d columns received",
+ newtup.ncols,
+ remoteattnum + 1, newtup.ncols)));
if (newtup.colstatus[remoteattnum] != LOGICALREP_COLUMN_UNCHANGED)
target_rte->updatedCols =
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index b6a7b3dad47..b60e382ad57 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1183,10 +1183,19 @@ ExportSnapshot(Snapshot snapshot)
snapshot->subxcnt + nchildren > GetMaxSnapshotSubxidCount())
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("cannot export snapshot with %d running transaction IDs",
- snapshot->subxcnt + nchildren),
- errdetail("A snapshot taken during recovery is exported with every transaction ID that it treats as running, and at most %d can be stored.",
- GetMaxSnapshotSubxidCount())));
+ errmsg_plural("cannot export snapshot with %d running transaction ID",
+ "cannot export snapshot with %d running transaction IDs",
+ snapshot->subxcnt + nchildren,
+ snapshot->subxcnt + nchildren),
+
+ /*
+ * The singular and plural strings below are identical in English but
+ * could differ in translations.
+ */
+ errdetail_plural("A snapshot taken during recovery is exported with every transaction ID that it treats as running, and at most %d can be stored.",
+ "A snapshot taken during recovery is exported with every transaction ID that it treats as running, and at most %d can be stored.",
+ GetMaxSnapshotSubxidCount(),
+ GetMaxSnapshotSubxidCount())));
/*
* Generate file path for the snapshot. We start numbering of snapshots
[parent: cc1edfa6c20b]