1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

Fix lack of message pluralization

Fixups for commits b99b74144f, 79b101486c, bf7d19be9b.
This commit is contained in:
Peter Eisentraut
2026-09-03 11:49:09 +02:00
parent cc1edfa6c2
commit ba7f9d95e6
3 changed files with 29 additions and 12 deletions

View File

@@ -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)
{

View File

@@ -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 =

View File

@@ -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