Skip to content

Commit edee0c6

Browse files
committed
Message style improvements
1 parent 894be11 commit edee0c6

23 files changed

+92
-87
lines changed

src/backend/access/transam/varsup.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ GetNewTransactionId(bool isSubXact)
153153
if (oldest_datname)
154154
ereport(ERROR,
155155
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
156-
errmsg("database is not accepting commands that assign new XIDs to avoid wraparound data loss in database \"%s\"",
156+
errmsg("database is not accepting commands that assign new transaction IDs to avoid wraparound data loss in database \"%s\"",
157157
oldest_datname),
158158
errhint("Execute a database-wide VACUUM in that database.\n"
159159
"You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
160160
else
161161
ereport(ERROR,
162162
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
163-
errmsg("database is not accepting commands that assign new XIDs to avoid wraparound data loss in database with OID %u",
163+
errmsg("database is not accepting commands that assign new transaction IDs to avoid wraparound data loss in database with OID %u",
164164
oldest_datoid),
165165
errhint("Execute a database-wide VACUUM in that database.\n"
166166
"You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
@@ -175,7 +175,7 @@ GetNewTransactionId(bool isSubXact)
175175
(errmsg("database \"%s\" must be vacuumed within %u transactions",
176176
oldest_datname,
177177
xidWrapLimit - xid),
178-
errhint("To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
178+
errhint("To avoid transaction ID assignment failures, execute a database-wide VACUUM in that database.\n"
179179
"You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
180180
else
181181
ereport(WARNING,

src/backend/access/transam/xact.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ AssignTransactionId(TransactionState s)
648648
if (IsInParallelMode() || IsParallelWorker())
649649
ereport(ERROR,
650650
(errcode(ERRCODE_INVALID_TRANSACTION_STATE),
651-
errmsg("cannot assign XIDs during a parallel operation")));
651+
errmsg("cannot assign transaction IDs during a parallel operation")));
652652

653653
/*
654654
* Ensure parent(s) have XIDs, so that a child always has an XID later

src/backend/backup/basebackup_incremental.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ manifest_process_system_identifier(JsonManifestParseContext *context,
953953

954954
if (manifest_system_identifier != system_identifier)
955955
context->error_cb(context,
956-
"manifest system identifier is %llu, but database system identifier is %llu",
956+
"system identifier in backup manifest is %llu, but database system identifier is %llu",
957957
(unsigned long long) manifest_system_identifier,
958958
(unsigned long long) system_identifier);
959959
}

src/backend/commands/copyfromparse.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -987,15 +987,15 @@ NextCopyFrom(CopyFromState cstate, ExprContext *econtext,
987987

988988
attval = CopyLimitPrintoutLength(cstate->cur_attval);
989989
ereport(NOTICE,
990-
errmsg("skipping row due to data type incompatibility at line %llu for column %s: \"%s\"",
990+
errmsg("skipping row due to data type incompatibility at line %llu for column \"%s\": \"%s\"",
991991
(unsigned long long) cstate->cur_lineno,
992992
cstate->cur_attname,
993993
attval));
994994
pfree(attval);
995995
}
996996
else
997997
ereport(NOTICE,
998-
errmsg("skipping row due to data type incompatibility at line %llu for column %s: null input",
998+
errmsg("skipping row due to data type incompatibility at line %llu for column \"%s\": null input",
999999
(unsigned long long) cstate->cur_lineno,
10001000
cstate->cur_attname));
10011001

src/backend/commands/subscriptioncmds.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ CheckAlterSubOption(Subscription *sub, const char *option,
10981098
if (sub->enabled)
10991099
ereport(ERROR,
11001100
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1101-
errmsg("cannot set %s for enabled subscription",
1101+
errmsg("cannot set option \"%s\" for enabled subscription",
11021102
option)));
11031103

11041104
if (slot_needs_update)
@@ -1112,7 +1112,7 @@ CheckAlterSubOption(Subscription *sub, const char *option,
11121112
if (!sub->slotname)
11131113
ereport(ERROR,
11141114
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1115-
errmsg("cannot set %s for a subscription that does not have a slot name",
1115+
errmsg("cannot set option \"%s\" for a subscription that does not have a slot name",
11161116
option)));
11171117

11181118
/* The changed option of the slot can't be rolled back. */

src/backend/commands/tablecmds.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -10713,7 +10713,7 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
1071310713
if (fk->confrelid == RelationGetRelid(partRel))
1071410714
ereport(ERROR,
1071510715
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
10716-
errmsg("can't attach table \"%s\" as a partition which is referenced by foreign key \"%s\"",
10716+
errmsg("cannot attach table \"%s\" as a partition because it is referenced by foreign key \"%s\"",
1071710717
RelationGetRelationName(partRel),
1071810718
get_constraint_name(fk->conoid))));
1071910719

src/backend/postmaster/walsummarizer.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,11 @@ WaitForWalSummarization(XLogRecPtr lsn)
752752
current_time) / 1000;
753753
ereport(WARNING,
754754
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
755-
errmsg("still waiting for WAL summarization through %X/%X after %ld seconds",
756-
LSN_FORMAT_ARGS(lsn),
757-
elapsed_seconds),
755+
errmsg_plural("still waiting for WAL summarization through %X/%X after %ld second",
756+
"still waiting for WAL summarization through %X/%X after %ld seconds",
757+
elapsed_seconds,
758+
LSN_FORMAT_ARGS(lsn),
759+
elapsed_seconds),
758760
errdetail("Summarization has reached %X/%X on disk and %X/%X in memory.",
759761
LSN_FORMAT_ARGS(summarized_lsn),
760762
LSN_FORMAT_ARGS(pending_lsn))));

src/backend/replication/logical/logical.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ CreateDecodingContext(XLogRecPtr start_lsn,
539539
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
540540
errmsg("cannot use replication slot \"%s\" for logical decoding",
541541
NameStr(slot->data.name)),
542-
errdetail("This slot is being synchronized from the primary server."),
542+
errdetail("This replication slot is being synchronized from the primary server."),
543543
errhint("Specify another replication slot."));
544544

545545
/*

src/backend/replication/logical/slotsync.c

+23-20
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ update_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid,
212212
* impact the users, so we used DEBUG1 level to log the message.
213213
*/
214214
ereport(slot->data.persistency == RS_TEMPORARY ? LOG : DEBUG1,
215-
errmsg("could not sync slot \"%s\" as remote slot precedes local slot",
215+
errmsg("could not synchronize replication slot \"%s\" because remote slot precedes local slot",
216216
remote_slot->name),
217-
errdetail("Remote slot has LSN %X/%X and catalog xmin %u, but local slot has LSN %X/%X and catalog xmin %u.",
217+
errdetail("The remote slot has LSN %X/%X and catalog xmin %u, but the local slot has LSN %X/%X and catalog xmin %u.",
218218
LSN_FORMAT_ARGS(remote_slot->restart_lsn),
219219
remote_slot->catalog_xmin,
220220
LSN_FORMAT_ARGS(slot->data.restart_lsn),
@@ -456,7 +456,7 @@ drop_local_obsolete_slots(List *remote_slot_list)
456456
0, AccessShareLock);
457457

458458
ereport(LOG,
459-
errmsg("dropped replication slot \"%s\" of dbid %u",
459+
errmsg("dropped replication slot \"%s\" of database with OID %u",
460460
NameStr(local_slot->data.name),
461461
local_slot->data.database));
462462
}
@@ -576,8 +576,8 @@ update_and_persist_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid)
576576
if (!found_consistent_snapshot)
577577
{
578578
ereport(LOG,
579-
errmsg("could not sync slot \"%s\"", remote_slot->name),
580-
errdetail("Logical decoding cannot find consistent point from local slot's LSN %X/%X.",
579+
errmsg("could not synchronize replication slot \"%s\"", remote_slot->name),
580+
errdetail("Logical decoding could not find consistent point from local slot's LSN %X/%X.",
581581
LSN_FORMAT_ARGS(slot->data.restart_lsn)));
582582

583583
return false;
@@ -586,7 +586,7 @@ update_and_persist_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid)
586586
ReplicationSlotPersist();
587587

588588
ereport(LOG,
589-
errmsg("newly created slot \"%s\" is sync-ready now",
589+
errmsg("newly created replication slot \"%s\" is sync-ready now",
590590
remote_slot->name));
591591

592592
return true;
@@ -625,7 +625,7 @@ synchronize_one_slot(RemoteSlot *remote_slot, Oid remote_dbid)
625625
*/
626626
ereport(AmLogicalSlotSyncWorkerProcess() ? LOG : ERROR,
627627
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
628-
errmsg("skipping slot synchronization as the received slot sync"
628+
errmsg("skipping slot synchronization because the received slot sync"
629629
" LSN %X/%X for slot \"%s\" is ahead of the standby position %X/%X",
630630
LSN_FORMAT_ARGS(remote_slot->confirmed_lsn),
631631
remote_slot->name,
@@ -992,10 +992,9 @@ validate_remote_info(WalReceiverConn *wrconn)
992992
if (!primary_slot_valid)
993993
ereport(ERROR,
994994
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
995-
errmsg("slot synchronization requires valid primary_slot_name"),
996995
/* translator: second %s is a GUC variable name */
997-
errdetail("The replication slot \"%s\" specified by %s does not exist on the primary server.",
998-
PrimarySlotName, "primary_slot_name"));
996+
errmsg("replication slot \"%s\" specified by \"%s\" does not exist on primary server",
997+
PrimarySlotName, "primary_slot_name"));
999998

1000999
ExecClearTuple(tupslot);
10011000
walrcv_clear_result(res);
@@ -1022,9 +1021,13 @@ CheckAndGetDbnameFromConninfo(void)
10221021
if (dbname == NULL)
10231022
ereport(ERROR,
10241023
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1025-
/* translator: dbname is a specific option; %s is a GUC variable name */
1026-
errmsg("slot synchronization requires dbname to be specified in %s",
1027-
"primary_conninfo"));
1024+
1025+
/*
1026+
* translator: first %s is a connection option; second %s is a GUC
1027+
* variable name
1028+
*/
1029+
errmsg("replication slot synchronization requires \"%s\" to be specified in \"%s\"",
1030+
"dbname", "primary_conninfo"));
10281031
return dbname;
10291032
}
10301033

@@ -1044,7 +1047,7 @@ ValidateSlotSyncParams(int elevel)
10441047
if (wal_level < WAL_LEVEL_LOGICAL)
10451048
ereport(ERROR,
10461049
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1047-
errmsg("slot synchronization requires \"wal_level\" >= \"logical\""));
1050+
errmsg("replication slot synchronization requires \"wal_level\" >= \"logical\""));
10481051

10491052
/*
10501053
* A physical replication slot(primary_slot_name) is required on the
@@ -1057,7 +1060,7 @@ ValidateSlotSyncParams(int elevel)
10571060
ereport(elevel,
10581061
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10591062
/* translator: %s is a GUC variable name */
1060-
errmsg("slot synchronization requires %s to be defined", "primary_slot_name"));
1063+
errmsg("replication slot synchronization requires \"%s\" to be set", "primary_slot_name"));
10611064
return false;
10621065
}
10631066

@@ -1071,7 +1074,7 @@ ValidateSlotSyncParams(int elevel)
10711074
ereport(elevel,
10721075
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10731076
/* translator: %s is a GUC variable name */
1074-
errmsg("slot synchronization requires %s to be enabled",
1077+
errmsg("replication slot synchronization requires \"%s\" to be enabled",
10751078
"hot_standby_feedback"));
10761079
return false;
10771080
}
@@ -1085,7 +1088,7 @@ ValidateSlotSyncParams(int elevel)
10851088
ereport(elevel,
10861089
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
10871090
/* translator: %s is a GUC variable name */
1088-
errmsg("slot synchronization requires %s to be defined",
1091+
errmsg("replication slot synchronization requires \"%s\" to be set",
10891092
"primary_conninfo"));
10901093
return false;
10911094
}
@@ -1123,7 +1126,7 @@ slotsync_reread_config(void)
11231126
{
11241127
ereport(LOG,
11251128
/* translator: %s is a GUC variable name */
1126-
errmsg("slot sync worker will shutdown because %s is disabled", "sync_replication_slots"));
1129+
errmsg("replication slot synchronization worker will shut down because \"%s\" is disabled", "sync_replication_slots"));
11271130
proc_exit(0);
11281131
}
11291132

@@ -1132,7 +1135,7 @@ slotsync_reread_config(void)
11321135
(old_hot_standby_feedback != hot_standby_feedback))
11331136
{
11341137
ereport(LOG,
1135-
errmsg("slot sync worker will restart because of a parameter change"));
1138+
errmsg("replication slot synchronization worker will restart because of a parameter change"));
11361139

11371140
/*
11381141
* Reset the last-start time for this worker so that the postmaster
@@ -1156,7 +1159,7 @@ ProcessSlotSyncInterrupts(WalReceiverConn *wrconn)
11561159
if (ShutdownRequestPending)
11571160
{
11581161
ereport(LOG,
1159-
errmsg("slot sync worker is shutting down on receiving SIGINT"));
1162+
errmsg("replication slot synchronization worker is shutting down on receiving SIGINT"));
11601163

11611164
proc_exit(0);
11621165
}

src/backend/replication/pgoutput/pgoutput.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ parse_output_parameters(List *options, PGOutputData *data)
404404
if (!protocol_version_given)
405405
ereport(ERROR,
406406
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
407-
errmsg("proto_version option missing"));
407+
errmsg("option \"%s\" missing", "proto_version"));
408408
if (!publication_names_given)
409409
ereport(ERROR,
410410
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
411-
errmsg("publication_names option missing"));
411+
errmsg("option \"%s\" missing", "publication_names"));
412412
}
413413

414414
/*

src/backend/replication/slot.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ ReplicationSlotDrop(const char *name, bool nowait)
795795
ereport(ERROR,
796796
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
797797
errmsg("cannot drop replication slot \"%s\"", name),
798-
errdetail("This slot is being synced from the primary server."));
798+
errdetail("This replication slot is being synchronized from the primary server."));
799799

800800
ReplicationSlotDropAcquired();
801801
}
@@ -830,7 +830,7 @@ ReplicationSlotAlter(const char *name, const bool *failover,
830830
ereport(ERROR,
831831
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
832832
errmsg("cannot alter replication slot \"%s\"", name),
833-
errdetail("This slot is being synced from the primary server."));
833+
errdetail("This replication slot is being synchronized from the primary server."));
834834

835835
/*
836836
* Do not allow users to enable failover on the standby as we do not
@@ -2656,11 +2656,11 @@ StandbySlotsHaveCaughtup(XLogRecPtr wait_for_lsn, int elevel)
26562656
*/
26572657
ereport(elevel,
26582658
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2659-
errmsg("replication slot \"%s\" specified in parameter %s does not exist",
2659+
errmsg("replication slot \"%s\" specified in parameter \"%s\" does not exist",
26602660
name, "synchronized_standby_slots"),
2661-
errdetail("Logical replication is waiting on the standby associated with \"%s\".",
2661+
errdetail("Logical replication is waiting on the standby associated with replication slot \"%s\".",
26622662
name),
2663-
errhint("Consider creating the slot \"%s\" or amend parameter %s.",
2663+
errhint("Create the replication slot \"%s\" or amend parameter \"%s\".",
26642664
name, "synchronized_standby_slots"));
26652665
break;
26662666
}
@@ -2677,11 +2677,11 @@ StandbySlotsHaveCaughtup(XLogRecPtr wait_for_lsn, int elevel)
26772677
*/
26782678
ereport(elevel,
26792679
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2680-
errmsg("cannot have logical replication slot \"%s\" in parameter %s",
2680+
errmsg("cannot specify logical replication slot \"%s\" in parameter \"%s\"",
26812681
name, "synchronized_standby_slots"),
2682-
errdetail("Logical replication is waiting for correction on \"%s\".",
2682+
errdetail("Logical replication is waiting for correction on replication slot \"%s\".",
26832683
name),
2684-
errhint("Consider removing logical slot \"%s\" from parameter %s.",
2684+
errhint("Remove the logical replication slot \"%s\" from parameter \"%s\".",
26852685
name, "synchronized_standby_slots"));
26862686
break;
26872687
}
@@ -2697,11 +2697,11 @@ StandbySlotsHaveCaughtup(XLogRecPtr wait_for_lsn, int elevel)
26972697
/* Specified physical slot has been invalidated */
26982698
ereport(elevel,
26992699
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2700-
errmsg("physical slot \"%s\" specified in parameter %s has been invalidated",
2700+
errmsg("physical replication slot \"%s\" specified in parameter \"%s\" has been invalidated",
27012701
name, "synchronized_standby_slots"),
2702-
errdetail("Logical replication is waiting on the standby associated with \"%s\".",
2702+
errdetail("Logical replication is waiting on the standby associated with replication slot \"%s\".",
27032703
name),
2704-
errhint("Consider dropping and recreating the slot \"%s\" or amend parameter %s.",
2704+
errhint("Drop and recreate the replication slot \"%s\", or amend parameter \"%s\".",
27052705
name, "synchronized_standby_slots"));
27062706
break;
27072707
}
@@ -2712,11 +2712,11 @@ StandbySlotsHaveCaughtup(XLogRecPtr wait_for_lsn, int elevel)
27122712
if (inactive)
27132713
ereport(elevel,
27142714
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2715-
errmsg("replication slot \"%s\" specified in parameter %s does not have active_pid",
2715+
errmsg("replication slot \"%s\" specified in parameter \"%s\" does not have active_pid",
27162716
name, "synchronized_standby_slots"),
2717-
errdetail("Logical replication is waiting on the standby associated with \"%s\".",
2717+
errdetail("Logical replication is waiting on the standby associated with replication slot \"%s\".",
27182718
name),
2719-
errhint("Consider starting standby associated with \"%s\" or amend parameter %s.",
2719+
errhint("Start the standby associated with the replication slot \"%s\", or amend parameter \"%s\".",
27202720
name, "synchronized_standby_slots"));
27212721

27222722
/* Continue if the current slot hasn't caught up. */

src/backend/rewrite/rewriteHandler.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3362,7 +3362,7 @@ rewriteTargetView(Query *parsetree, Relation view)
33623362
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
33633363
errmsg("cannot merge into view \"%s\"",
33643364
RelationGetRelationName(view)),
3365-
errdetail("MERGE is not supported for views with INSTEAD OF triggers for some actions, but not others."),
3365+
errdetail("MERGE is not supported for views with INSTEAD OF triggers for some actions but not all."),
33663366
errhint("To enable merging into the view, either provide a full set of INSTEAD OF triggers or drop the existing INSTEAD OF triggers."));
33673367
}
33683368
}

src/backend/utils/adt/jsonpath_exec.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
13821382
if (res == jperNotFound)
13831383
RETURN_ERROR(ereport(ERROR,
13841384
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1385-
errmsg("jsonpath item method .%s() can only be applied to a bool, string, or numeric value",
1385+
errmsg("jsonpath item method .%s() can only be applied to a boolean, string, or numeric value",
13861386
jspOperationName(jsp->type)))));
13871387

13881388
jb = &jbv;
@@ -1663,7 +1663,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
16631663
case jbvBinary:
16641664
RETURN_ERROR(ereport(ERROR,
16651665
(errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
1666-
errmsg("jsonpath item method .%s() can only be applied to a bool, string, numeric, or datetime value",
1666+
errmsg("jsonpath item method .%s() can only be applied to a boolean, string, numeric, or datetime value",
16671667
jspOperationName(jsp->type)))));
16681668
break;
16691669
}
@@ -3984,12 +3984,12 @@ JsonPathQuery(Datum jb, JsonPath *jp, JsonWrapper wrapper, bool *empty,
39843984
(errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
39853985
errmsg("JSON path expression for column \"%s\" should return single item without wrapper",
39863986
column_name),
3987-
errhint("Use WITH WRAPPER clause to wrap SQL/JSON items into array.")));
3987+
errhint("Use the WITH WRAPPER clause to wrap SQL/JSON items into an array.")));
39883988
else
39893989
ereport(ERROR,
39903990
(errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM),
39913991
errmsg("JSON path expression in JSON_QUERY should return single item without wrapper"),
3992-
errhint("Use WITH WRAPPER clause to wrap SQL/JSON items into array.")));
3992+
errhint("Use the WITH WRAPPER clause to wrap SQL/JSON items into an array.")));
39933993
}
39943994

39953995
if (singleton)

0 commit comments

Comments
 (0)