Skip to content

Commit 50fd428

Browse files
committed
Message style improvements
1 parent bbccf7e commit 50fd428

File tree

19 files changed

+40
-36
lines changed

19 files changed

+40
-36
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ lazy_scan_heap(LVRelState *vacrel)
14281428
*/
14291429
if (vacrel->eager_scan_max_fails_per_region > 0)
14301430
ereport(vacrel->verbose ? INFO : DEBUG2,
1431-
(errmsg("disabling eager scanning after freezing %u eagerly scanned blocks of \"%s.%s.%s\"",
1431+
(errmsg("disabling eager scanning after freezing %u eagerly scanned blocks of relation \"%s.%s.%s\"",
14321432
orig_eager_scan_success_limit,
14331433
vacrel->dbname, vacrel->relnamespace,
14341434
vacrel->relname)));

src/backend/catalog/heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3006,7 +3006,7 @@ AddRelationNotNullConstraints(Relation rel, List *constraints,
30063006
if (constr->is_no_inherit)
30073007
ereport(ERROR,
30083008
(errcode(ERRCODE_DATATYPE_MISMATCH),
3009-
errmsg("cannot define not-null constraint on column \"%s\" with NO INHERIT",
3009+
errmsg("cannot define not-null constraint with NO INHERIT on column \"%s\"",
30103010
strVal(linitial(constr->keys))),
30113011
errdetail("The column has an inherited not-null constraint.")));
30123012

src/backend/commands/matview.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ refresh_by_match_merge(Oid matviewOid, Oid tempOid, Oid relowner,
835835
if (!foundUniqueIndex)
836836
ereport(ERROR,
837837
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
838-
errmsg("could not find suitable unique index on materialized view"));
838+
errmsg("could not find suitable unique index on materialized view \"%s\"",
839+
RelationGetRelationName(matviewRel)));
839840

840841
appendStringInfoString(&querybuf,
841842
" AND newdata.* OPERATOR(pg_catalog.*=) mv.*) "

src/backend/commands/publicationcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,8 +2130,8 @@ defGetGeneratedColsOption(DefElem *def)
21302130

21312131
ereport(ERROR,
21322132
errcode(ERRCODE_SYNTAX_ERROR),
2133-
errmsg("%s requires a \"none\" or \"stored\" value",
2134-
def->defname));
2133+
errmsg("invalid value for publication parameter \"%s\": \"%s\"", def->defname, sval),
2134+
errdetail("Valid values are \"%s\" and \"%s\".", "none", "stored"));
21352135

21362136
return PUBLISH_GENCOLS_NONE; /* keep compiler quiet */
21372137
}

src/backend/commands/subscriptioncmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
12671267
IsSet(opts.specified_opts, SUBOPT_SLOT_NAME))
12681268
ereport(ERROR,
12691269
(errcode(ERRCODE_SYNTAX_ERROR),
1270-
errmsg("slot_name and two_phase cannot be altered at the same time")));
1270+
errmsg("\"slot_name\" and \"two_phase\" cannot be altered at the same time")));
12711271

12721272
/*
12731273
* Note that workers may still survive even if the
@@ -1283,7 +1283,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
12831283
if (logicalrep_workers_find(subid, true, true))
12841284
ereport(ERROR,
12851285
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1286-
errmsg("cannot alter two_phase when logical replication worker is still running"),
1286+
errmsg("cannot alter \"two_phase\" when logical replication worker is still running"),
12871287
errhint("Try again after some time.")));
12881288

12891289
/*
@@ -1297,7 +1297,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
12971297
LookupGXactBySubid(subid))
12981298
ereport(ERROR,
12991299
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1300-
errmsg("cannot disable two_phase when prepared transactions are present"),
1300+
errmsg("cannot disable \"two_phase\" when prepared transactions exist"),
13011301
errhint("Resolve these transactions and try again.")));
13021302

13031303
/* Change system catalog accordingly */

src/backend/commands/tablecmds.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8609,7 +8609,7 @@ ATExecSetExpression(AlteredTableInfo *tab, Relation rel, const char *colName,
86098609
rel->rd_att->constr && rel->rd_att->constr->num_check > 0)
86108610
ereport(ERROR,
86118611
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
8612-
errmsg("ALTER TABLE / SET EXPRESSION is not supported for virtual generated columns on tables with check constraints"),
8612+
errmsg("ALTER TABLE / SET EXPRESSION is not supported for virtual generated columns in tables with check constraints"),
86138613
errdetail("Column \"%s\" of relation \"%s\" is a virtual generated column.",
86148614
colName, RelationGetRelationName(rel))));
86158615

@@ -8627,7 +8627,7 @@ ATExecSetExpression(AlteredTableInfo *tab, Relation rel, const char *colName,
86278627
GetRelationPublications(RelationGetRelid(rel)) != NIL)
86288628
ereport(ERROR,
86298629
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
8630-
errmsg("ALTER TABLE / SET EXPRESSION is not supported for virtual generated columns on tables that are part of a publication"),
8630+
errmsg("ALTER TABLE / SET EXPRESSION is not supported for virtual generated columns in tables that are part of a publication"),
86318631
errdetail("Column \"%s\" of relation \"%s\" is a virtual generated column.",
86328632
colName, RelationGetRelationName(rel))));
86338633

@@ -10189,7 +10189,7 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel,
1018910189
if (pk_has_without_overlaps && !with_period)
1019010190
ereport(ERROR,
1019110191
errcode(ERRCODE_INVALID_FOREIGN_KEY),
10192-
errmsg("foreign key must use PERIOD when referencing a primary using WITHOUT OVERLAPS"));
10192+
errmsg("foreign key must use PERIOD when referencing a primary key using WITHOUT OVERLAPS"));
1019310193

1019410194
/*
1019510195
* Now we can check permissions.
@@ -12913,8 +12913,9 @@ ATExecValidateConstraint(List **wqueue, Relation rel, char *constrName,
1291312913
con->contype != CONSTRAINT_NOTNULL)
1291412914
ereport(ERROR,
1291512915
errcode(ERRCODE_WRONG_OBJECT_TYPE),
12916-
errmsg("constraint \"%s\" of relation \"%s\" is not a foreign key, check, or not-null constraint",
12917-
constrName, RelationGetRelationName(rel)));
12916+
errmsg("cannot validate constraint \"%s\" of relation \"%s\"",
12917+
constrName, RelationGetRelationName(rel)),
12918+
errdetail("This operation is not supported for this type of constraint."));
1291812919

1291912920
if (!con->conenforced)
1292012921
ereport(ERROR,

src/backend/libpq/be-secure-openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,10 +1436,10 @@ initialize_ecdh(SSL_CTX *context, bool isServerStart)
14361436
*/
14371437
ereport(isServerStart ? FATAL : LOG,
14381438
errcode(ERRCODE_CONFIG_FILE_ERROR),
1439-
errmsg("failed to set group names specified in ssl_groups: %s",
1439+
errmsg("could not set group names specified in ssl_groups: %s",
14401440
SSLerrmessageExt(ERR_get_error(),
14411441
_("No valid groups found"))),
1442-
errhint("Ensure that each group name is spelled correctly and supported by the installed version of OpenSSL"));
1442+
errhint("Ensure that each group name is spelled correctly and supported by the installed version of OpenSSL."));
14431443
return false;
14441444
}
14451445
#endif

src/backend/replication/logical/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ logicalrep_worker_launch(LogicalRepWorkerType wtype,
341341
if (max_active_replication_origins == 0)
342342
ereport(ERROR,
343343
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
344-
errmsg("cannot start logical replication workers when \"max_active_replication_origins\"=0")));
344+
errmsg("cannot start logical replication workers when \"max_active_replication_origins\" is 0")));
345345

346346
/*
347347
* We need to do the modification of the shared memory under lock so that

src/backend/replication/logical/slotsync.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ update_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid,
213213
ereport(slot->data.persistency == RS_TEMPORARY ? LOG : DEBUG1,
214214
errmsg("could not synchronize replication slot \"%s\"",
215215
remote_slot->name),
216-
errdetail("Synchronization could lead to data loss as the remote slot needs WAL at LSN %X/%X and catalog xmin %u, but the standby has LSN %X/%X and catalog xmin %u.",
216+
errdetail("Synchronization could lead to data loss, because the remote slot needs WAL at LSN %X/%X and catalog xmin %u, but the standby has LSN %X/%X and catalog xmin %u.",
217217
LSN_FORMAT_ARGS(remote_slot->restart_lsn),
218218
remote_slot->catalog_xmin,
219219
LSN_FORMAT_ARGS(slot->data.restart_lsn),
@@ -593,7 +593,7 @@ update_and_persist_local_synced_slot(RemoteSlot *remote_slot, Oid remote_dbid)
593593
{
594594
ereport(LOG,
595595
errmsg("could not synchronize replication slot \"%s\"", remote_slot->name),
596-
errdetail("Synchronization could lead to data loss as standby could not build a consistent snapshot to decode WALs at LSN %X/%X.",
596+
errdetail("Synchronization could lead to data loss, because the standby could not build a consistent snapshot to decode WALs at LSN %X/%X.",
597597
LSN_FORMAT_ARGS(slot->data.restart_lsn)));
598598

599599
return false;

src/backend/replication/pgoutput/pgoutput.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ LoadPublications(List *pubnames)
17891789
else
17901790
ereport(WARNING,
17911791
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1792-
errmsg("skipped loading publication: %s", pubname),
1792+
errmsg("skipped loading publication \"%s\"", pubname),
17931793
errdetail("The publication does not exist at this point in the WAL."),
17941794
errhint("Create the publication if it does not exist."));
17951795
}

0 commit comments

Comments
 (0)