postgres.git / summary / log / commit / refs
commit bb238161f910cefe67c7c24522e817c831ea4909
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 911045b9b9d..3a085e8379c 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -892,8 +892,10 @@ CreateTriggerFiringOn(const 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 ecfee173c95..c3b427506a7 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -1048,8 +1048,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];
@@ -1165,8 +1167,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)
{
@@ -2888,8 +2892,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_perminfo->updatedCols =
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 73894eeecec..11ebe715a86 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1175,10 +1175,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: 08b016edd568]