diff options
| author | Peter Eisentraut | 2026-09-03 09:49:09 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2026-09-03 09:54:53 +0000 |
| commit | df530e2342d1190b7b6d6893c524c5898f814acc (patch) | |
| tree | 82591b4f654b328a6784d562de8c0008c295b250 | |
| parent | a90cbbc86f996f1a20e83d47c4bc65bcb2baa0a0 (diff) | |
Fix lack of message pluralization
Fixups for commits b99b74144f9, 79b101486c1, bf7d19be9b1.
| -rw-r--r-- | src/backend/commands/trigger.c | 6 | ||||
| -rw-r--r-- | src/backend/replication/logical/worker.c | 18 | ||||
| -rw-r--r-- | 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 b393ee87ad1..6809931dfab 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -892,8 +892,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 76367458768..85cbc734f5f 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -833,8 +833,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]; @@ -950,8 +952,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) { @@ -2625,8 +2629,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 918f201f3bd..05cb84c410a 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -1185,10 +1185,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 |
