aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2021-06-28 08:36:44 +0200
committerPeter Eisentraut <peter@eisentraut.org>2021-06-28 08:36:44 +0200
commitc31833779d5a4775d7220be4b9143bec66c9a9fd (patch)
tree2f7c8b67887cb09fdcb4b6cb4ed95cf9f0c65a71 /src/backend
parentee3fdb8f3465b3a5937a7fe647b7b6584a600647 (diff)
downloadpostgresql-c31833779d5a4775d7220be4b9143bec66c9a9fd.tar.gz
postgresql-c31833779d5a4775d7220be4b9143bec66c9a9fd.zip
Message style improvements
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/common/toast_compression.c2
-rw-r--r--src/backend/catalog/catalog.c14
-rw-r--r--src/backend/catalog/pg_inherits.c2
-rw-r--r--src/backend/commands/tablecmds.c2
-rw-r--r--src/backend/postmaster/pgstat.c2
-rw-r--r--src/backend/storage/file/fd.c4
-rw-r--r--src/backend/storage/ipc/standby.c18
-rw-r--r--src/backend/tcop/fastpath.c2
-rw-r--r--src/backend/utils/adt/multirangetypes.c4
9 files changed, 27 insertions, 23 deletions
diff --git a/src/backend/access/common/toast_compression.c b/src/backend/access/common/toast_compression.c
index 9e9d4457ace..845618349fe 100644
--- a/src/backend/access/common/toast_compression.c
+++ b/src/backend/access/common/toast_compression.c
@@ -29,7 +29,7 @@ int default_toast_compression = TOAST_PGLZ_COMPRESSION;
#define NO_LZ4_SUPPORT() \
ereport(ERROR, \
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
- errmsg("unsupported LZ4 compression method"), \
+ errmsg("compression method lz4 not supported"), \
errdetail("This functionality requires the server to be built with lz4 support."), \
errhint("You need to rebuild PostgreSQL using %s.", "--with-lz4")))
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index 245d5363726..7cabe741c66 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -375,10 +375,12 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
if (retries >= retries_before_log)
{
ereport(LOG,
- (errmsg("still finding an unused OID within relation \"%s\"",
+ (errmsg("still searching for an unused OID in relation \"%s\"",
RelationGetRelationName(relation)),
- errdetail("OID candidates were checked \"%llu\" times, but no unused OID is yet found.",
- (unsigned long long) retries)));
+ errdetail_plural("OID candidates have been checked %llu time, but no unused OID has been found yet.",
+ "OID candidates have been checked %llu times, but no unused OID has been found yet.",
+ retries,
+ (unsigned long long) retries)));
/*
* Double the number of retries to do before logging next until it
@@ -400,8 +402,10 @@ GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
if (retries > GETNEWOID_LOG_THRESHOLD)
{
ereport(LOG,
- (errmsg("new OID has been assigned in relation \"%s\" after \"%llu\" retries",
- RelationGetRelationName(relation), (unsigned long long) retries)));
+ (errmsg_plural("new OID has been assigned in relation \"%s\" after %llu retry",
+ "new OID has been assigned in relation \"%s\" after %llu retries",
+ retries,
+ RelationGetRelationName(relation), (unsigned long long) retries)));
}
return newOid;
diff --git a/src/backend/catalog/pg_inherits.c b/src/backend/catalog/pg_inherits.c
index 1c37a438c39..ae990d48776 100644
--- a/src/backend/catalog/pg_inherits.c
+++ b/src/backend/catalog/pg_inherits.c
@@ -593,7 +593,7 @@ DeleteInheritsTuple(Oid inhrelid, Oid inhparent, bool expect_detach_pending,
errmsg("cannot detach partition \"%s\"",
childname ? childname : "unknown relation"),
errdetail("The partition is being detached concurrently or has an unfinished detach."),
- errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation")));
+ errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation.")));
if (!detach_pending && expect_detach_pending)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 4e23c7fce5f..97a9725df75 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -14773,7 +14773,7 @@ MarkInheritDetached(Relation child_rel, Relation parent_rel)
get_rel_name(inhForm->inhrelid),
get_namespace_name(parent_rel->rd_rel->relnamespace),
RelationGetRelationName(parent_rel)),
- errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the detach operation."));
+ errhint("Use ALTER TABLE ... DETACH PARTITION ... FINALIZE to complete the pending detach operation."));
if (inhForm->inhrelid == RelationGetRelid(child_rel))
{
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index b0d07c0e0bb..ce8888cc300 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -1457,7 +1457,7 @@ pgstat_reset_shared_counters(const char *target)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized reset target: \"%s\"", target),
- errhint("Target must be \"archiver\", \"bgwriter\" or \"wal\".")));
+ errhint("Target must be \"archiver\", \"bgwriter\", or \"wal\".")));
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_RESETSHAREDCOUNTER);
pgstat_send(&msg, sizeof(msg));
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index e8cd7ef0886..a340a5f6afe 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -3295,13 +3295,13 @@ do_syncfs(const char *path)
{
ereport(LOG,
(errcode_for_file_access(),
- errmsg("could not open %s: %m", path)));
+ errmsg("could not open file \"%s\": %m", path)));
return;
}
if (syncfs(fd) < 0)
ereport(LOG,
(errcode_for_file_access(),
- errmsg("could not sync filesystem for \"%s\": %m", path)));
+ errmsg("could not synchronize file system for file \"%s\": %m", path)));
CloseTransientFile(fd);
}
#endif
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 553b6e54603..aeecaf6cabf 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -303,7 +303,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
{
ereport(LOG,
errmsg("recovery still waiting after %ld.%03d ms: %s",
- msecs, usecs, _(get_recovery_conflict_desc(reason))),
+ msecs, usecs, get_recovery_conflict_desc(reason)),
nprocs > 0 ? errdetail_log_plural("Conflicting process: %s.",
"Conflicting processes: %s.",
nprocs, buf.data) : 0);
@@ -312,7 +312,7 @@ LogRecoveryConflict(ProcSignalReason reason, TimestampTz wait_start,
{
ereport(LOG,
errmsg("recovery finished waiting after %ld.%03d ms: %s",
- msecs, usecs, _(get_recovery_conflict_desc(reason))));
+ msecs, usecs, get_recovery_conflict_desc(reason)));
}
if (nprocs > 0)
@@ -1418,27 +1418,27 @@ LogStandbyInvalidations(int nmsgs, SharedInvalidationMessage *msgs,
static const char *
get_recovery_conflict_desc(ProcSignalReason reason)
{
- const char *reasonDesc = gettext_noop("unknown reason");
+ const char *reasonDesc = _("unknown reason");
switch (reason)
{
case PROCSIG_RECOVERY_CONFLICT_BUFFERPIN:
- reasonDesc = gettext_noop("recovery conflict on buffer pin");
+ reasonDesc = _("recovery conflict on buffer pin");
break;
case PROCSIG_RECOVERY_CONFLICT_LOCK:
- reasonDesc = gettext_noop("recovery conflict on lock");
+ reasonDesc = _("recovery conflict on lock");
break;
case PROCSIG_RECOVERY_CONFLICT_TABLESPACE:
- reasonDesc = gettext_noop("recovery conflict on tablespace");
+ reasonDesc = _("recovery conflict on tablespace");
break;
case PROCSIG_RECOVERY_CONFLICT_SNAPSHOT:
- reasonDesc = gettext_noop("recovery conflict on snapshot");
+ reasonDesc = _("recovery conflict on snapshot");
break;
case PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK:
- reasonDesc = gettext_noop("recovery conflict on buffer deadlock");
+ reasonDesc = _("recovery conflict on buffer deadlock");
break;
case PROCSIG_RECOVERY_CONFLICT_DATABASE:
- reasonDesc = gettext_noop("recovery conflict on database");
+ reasonDesc = _("recovery conflict on database");
break;
default:
break;
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c
index 9fa8997cb30..6343dd269b4 100644
--- a/src/backend/tcop/fastpath.c
+++ b/src/backend/tcop/fastpath.c
@@ -145,7 +145,7 @@ fetch_fp_info(Oid func_id, struct fp_info *fip)
if (pp->prokind != PROKIND_FUNCTION || pp->proretset)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot call function %s via fastpath interface",
+ errmsg("cannot call function \"%s\" via fastpath interface",
NameStr(pp->proname))));
/* watch out for catalog entries with more than FUNC_MAX_ARGS args */
diff --git a/src/backend/utils/adt/multirangetypes.c b/src/backend/utils/adt/multirangetypes.c
index fbcc27d0726..7aeec7617fc 100644
--- a/src/backend/utils/adt/multirangetypes.c
+++ b/src/backend/utils/adt/multirangetypes.c
@@ -282,7 +282,7 @@ multirange_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("malformed multirange literal: \"%s\"",
input_str),
- errdetail("Junk after right brace.")));
+ errdetail("Junk after closing right brace.")));
ret = make_multirange(mltrngtypoid, rangetyp, range_count, ranges);
PG_RETURN_MULTIRANGE_P(ret);
@@ -968,7 +968,7 @@ multirange_constructor2(PG_FUNCTION_ARGS)
if (dims > 1)
ereport(ERROR,
(errcode(ERRCODE_CARDINALITY_VIOLATION),
- errmsg("multiranges cannot be constructed from multi-dimensional arrays")));
+ errmsg("multiranges cannot be constructed from multidimensional arrays")));
rngtypid = ARR_ELEMTYPE(rangeArray);
if (rngtypid != rangetyp->type_id)