Skip to content

Commit 517484b

Browse files
committed
Message style improvements
1 parent 8d98556 commit 517484b

29 files changed

+64
-68
lines changed

src/backend/access/transam/xlogprefetcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ check_recovery_prefetch(int *new_value, void **extra, GucSource source)
10871087
#ifndef USE_PREFETCH
10881088
if (*new_value == RECOVERY_PREFETCH_ON)
10891089
{
1090-
GUC_check_errdetail("recovery_prefetch not supported on platforms that lack posix_fadvise().");
1090+
GUC_check_errdetail("recovery_prefetch is not supported on platforms that lack posix_fadvise().");
10911091
return false;
10921092
}
10931093
#endif

src/backend/access/transam/xlogreader.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,10 +1961,10 @@ XLogRecGetBlockTag(XLogReaderState *record, uint8 block_id,
19611961
NULL))
19621962
{
19631963
#ifndef FRONTEND
1964-
elog(ERROR, "failed to locate backup block with ID %d in WAL record",
1964+
elog(ERROR, "could not locate backup block with ID %d in WAL record",
19651965
block_id);
19661966
#else
1967-
pg_fatal("failed to locate backup block with ID %d in WAL record",
1967+
pg_fatal("could not locate backup block with ID %d in WAL record",
19681968
block_id);
19691969
#endif
19701970
}

src/backend/backup/basebackup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ parse_basebackup_options(List *options, basebackup_options *opt)
862862
if (!parse_compress_algorithm(optval, &opt->compression))
863863
ereport(ERROR,
864864
(errcode(ERRCODE_SYNTAX_ERROR),
865-
errmsg("unrecognized compression algorithm \"%s\"",
865+
errmsg("unrecognized compression algorithm: \"%s\"",
866866
optval)));
867867
o_compression = true;
868868
}
@@ -918,7 +918,7 @@ parse_basebackup_options(List *options, basebackup_options *opt)
918918
if (o_compression_detail && !o_compression)
919919
ereport(ERROR,
920920
(errcode(ERRCODE_SYNTAX_ERROR),
921-
errmsg("compression detail requires compression")));
921+
errmsg("compression detail cannot be specified unless compression is enabled")));
922922

923923
if (o_compression)
924924
{

src/backend/backup/basebackup_server.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ bbsink_server_new(bbsink *next, char *pathname)
7272
if (!has_privs_of_role(GetUserId(), ROLE_PG_WRITE_SERVER_FILES))
7373
ereport(ERROR,
7474
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
75-
errmsg("must be superuser or a role with privileges of the pg_write_server_files role to create server backup")));
75+
errmsg("must be superuser or a role with privileges of the pg_write_server_files role to create backup stored on server")));
7676
CommitTransactionCommand();
7777

7878
/*
@@ -86,7 +86,7 @@ bbsink_server_new(bbsink *next, char *pathname)
8686
if (!is_absolute_path(pathname))
8787
ereport(ERROR,
8888
(errcode(ERRCODE_INVALID_NAME),
89-
errmsg("relative path not allowed for server backup")));
89+
errmsg("relative path not allowed for backup stored on server")));
9090

9191
switch (pg_check_dir(pathname))
9292
{

src/backend/catalog/pg_publication.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,13 @@ publication_translate_columns(Relation targetrel, List *columns,
513513
if (!AttrNumberIsForUserDefinedAttr(attnum))
514514
ereport(ERROR,
515515
errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
516-
errmsg("cannot reference system column \"%s\" in publication column list",
516+
errmsg("cannot use system column \"%s\" in publication column list",
517517
colname));
518518

519519
if (TupleDescAttr(tupdesc, attnum - 1)->attgenerated)
520520
ereport(ERROR,
521521
errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
522-
errmsg("cannot reference generated column \"%s\" in publication column list",
522+
errmsg("cannot use generated column \"%s\" in publication column list",
523523
colname));
524524

525525
if (bms_is_member(attnum, set))

src/backend/commands/dbcommands.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
991991
else
992992
ereport(ERROR,
993993
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
994-
errmsg("invalid create database strategy %s", strategy),
994+
errmsg("invalid create database strategy \"%s\"", strategy),
995995
errhint("Valid strategies are \"wal_log\", and \"file_copy\".")));
996996
}
997997

src/backend/commands/publicationcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ check_simple_rowfilter_expr_walker(Node *node, ParseState *pstate)
575575
/* OK, supported */
576576
break;
577577
default:
578-
errdetail_msg = _("Expressions only allow columns, constants, built-in operators, built-in data types, built-in collations, and immutable built-in functions.");
578+
errdetail_msg = _("Only columns, constants, built-in operators, built-in data types, built-in collations, and immutable built-in functions are allowed.");
579579
break;
580580
}
581581

@@ -1359,7 +1359,7 @@ CheckAlterPublication(AlterPublicationStmt *stmt, HeapTuple tup,
13591359
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
13601360
errmsg("publication \"%s\" is defined as FOR ALL TABLES",
13611361
NameStr(pubform->pubname)),
1362-
errdetail("Tables from schema cannot be added to, dropped from, or set on FOR ALL TABLES publications.")));
1362+
errdetail("Schemas cannot be added to or dropped from FOR ALL TABLES publications.")));
13631363

13641364
/* Check that user is allowed to manipulate the publication tables. */
13651365
if (tables && pubform->puballtables)

src/backend/commands/subscriptioncmds.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,8 @@ check_publications(WalReceiverConn *wrconn, List *publications)
430430

431431
if (res->status != WALRCV_OK_TUPLES)
432432
ereport(ERROR,
433-
errmsg_plural("could not receive publication from the publisher: %s",
434-
"could not receive list of publications from the publisher: %s",
435-
list_length(publications),
436-
res->err));
433+
errmsg("could not receive list of publications from the publisher: %s",
434+
res->err));
437435

438436
publicationsCopy = list_copy(publications);
439437

src/backend/commands/trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ renametrig(RenameStmt *stmt)
15711571
ereport(ERROR,
15721572
errmsg("cannot rename trigger \"%s\" on table \"%s\"",
15731573
stmt->subname, RelationGetRelationName(targetrel)),
1574-
errhint("Rename trigger on partitioned table \"%s\" instead.",
1574+
errhint("Rename the trigger on the partitioned table \"%s\" instead.",
15751575
get_rel_name(get_partition_parent(relid, false))));
15761576

15771577

src/backend/executor/nodeModifyTable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,10 +2082,10 @@ ExecCrossPartitionUpdateForeignKey(ModifyTableContext *context,
20822082
ereport(ERROR,
20832083
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
20842084
errmsg("cannot move tuple across partitions when a non-root ancestor of the source partition is directly referenced in a foreign key"),
2085-
errdetail("A foreign key points to ancestor \"%s\", but not the root ancestor \"%s\".",
2085+
errdetail("A foreign key points to ancestor \"%s\" but not the root ancestor \"%s\".",
20862086
RelationGetRelationName(rInfo->ri_RelationDesc),
20872087
RelationGetRelationName(rootRelInfo->ri_RelationDesc)),
2088-
errhint("Consider defining the foreign key on \"%s\".",
2088+
errhint("Consider defining the foreign key on table \"%s\".",
20892089
RelationGetRelationName(rootRelInfo->ri_RelationDesc))));
20902090
}
20912091

0 commit comments

Comments
 (0)