Skip to content

Commit 8fb4218

Browse files
committed
Message improvements
1 parent 1c73485 commit 8fb4218

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

src/backend/libpq/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ auth_peer(hbaPort *port)
15901590
if (!pw)
15911591
{
15921592
ereport(LOG,
1593-
(errmsg("failed to look up local user id %ld: %s",
1593+
(errmsg("could not to look up local user ID %ld: %s",
15941594
(long) uid, errno ? strerror(errno) : _("user does not exist"))));
15951595
return STATUS_ERROR;
15961596
}

src/backend/replication/logical/logical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ CreateInitDecodingContext(char *plugin,
218218
if (slot->data.database == InvalidOid)
219219
ereport(ERROR,
220220
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
221-
errmsg("cannot use physical replication slot created for logical decoding")));
221+
errmsg("cannot use physical replication slot for logical decoding")));
222222

223223
if (slot->data.database != MyDatabaseId)
224224
ereport(ERROR,
@@ -410,7 +410,7 @@ CreateDecodingContext(XLogRecPtr start_lsn,
410410
MemoryContextSwitchTo(old_context);
411411

412412
ereport(LOG,
413-
(errmsg("starting logical decoding for slot %s",
413+
(errmsg("starting logical decoding for slot \"%s\"",
414414
NameStr(slot->data.name)),
415415
errdetail("streaming transactions committing after %X/%X, reading WAL from %X/%X",
416416
(uint32) (slot->data.confirmed_flush >> 32),

src/backend/replication/logical/reorderbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,7 @@ ReorderBufferRestoreChanges(ReorderBuffer *rb, ReorderBufferTXN *txn,
21982198
else if (readBytes != sizeof(ReorderBufferDiskChange))
21992199
ereport(ERROR,
22002200
(errcode_for_file_access(),
2201-
errmsg("incomplete read from reorderbuffer spill file: read %d instead of %u bytes",
2201+
errmsg("could not read from reorderbuffer spill file: read %d instead of %u bytes",
22022202
readBytes,
22032203
(uint32) sizeof(ReorderBufferDiskChange))));
22042204

src/backend/replication/logical/snapbuild.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,10 @@ SnapBuildExportSnapshot(SnapBuild *builder)
598598
snapname = ExportSnapshot(snap);
599599

600600
ereport(LOG,
601-
(errmsg("exported logical decoding snapshot: \"%s\" with %u xids",
602-
snapname, snap->xcnt)));
601+
(errmsg_plural("exported logical decoding snapshot: \"%s\" with %u transaction ID",
602+
"exported logical decoding snapshot: \"%s\" with %u transaction IDs",
603+
snap->xcnt,
604+
snapname, snap->xcnt)));
603605
return snapname;
604606
}
605607

@@ -901,7 +903,7 @@ SnapBuildEndTxn(SnapBuild *builder, XLogRecPtr lsn, TransactionId xid)
901903
ereport(LOG,
902904
(errmsg("logical decoding found consistent point at %X/%X",
903905
(uint32) (lsn >> 32), (uint32) lsn),
904-
errdetail("xid %u finished, no running transactions anymore",
906+
errdetail("Transaction ID %u finished; no more running transactions.",
905907
xid)));
906908
builder->state = SNAPBUILD_CONSISTENT;
907909
}
@@ -1228,9 +1230,9 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn
12281230
builder->initial_xmin_horizon))
12291231
{
12301232
ereport(DEBUG1,
1231-
(errmsg("skipping snapshot at %X/%X while building logical decoding snapshot, xmin horizon too low",
1233+
(errmsg_internal("skipping snapshot at %X/%X while building logical decoding snapshot, xmin horizon too low",
12321234
(uint32) (lsn >> 32), (uint32) lsn),
1233-
errdetail("initial xmin horizon of %u vs the snapshot's %u",
1235+
errdetail_internal("initial xmin horizon of %u vs the snapshot's %u",
12341236
builder->initial_xmin_horizon, running->oldestRunningXid)));
12351237
return true;
12361238
}
@@ -1324,7 +1326,10 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn
13241326
ereport(LOG,
13251327
(errmsg("logical decoding found initial starting point at %X/%X",
13261328
(uint32) (lsn >> 32), (uint32) lsn),
1327-
errdetail("%u xacts need to finish", (uint32) builder->running.xcnt)));
1329+
errdetail_plural("%u transaction needs to finish.",
1330+
"%u transactions need to finish.",
1331+
builder->running.xcnt,
1332+
(uint32) builder->running.xcnt)));
13281333

13291334
/*
13301335
* Iterate through all xids, wait for them to finish.

src/backend/replication/slot.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,7 @@ CheckPointReplicationSlots(void)
797797
{
798798
int i;
799799

800-
ereport(DEBUG1,
801-
(errmsg("performing replication slot checkpoint")));
800+
elog(DEBUG1, "performing replication slot checkpoint");
802801

803802
/*
804803
* Prevent any slot from being created/dropped while we're active. As we
@@ -834,8 +833,7 @@ StartupReplicationSlots(void)
834833
DIR *replication_dir;
835834
struct dirent *replication_de;
836835

837-
ereport(DEBUG1,
838-
(errmsg("starting up replication slots")));
836+
elog(DEBUG1, "starting up replication slots");
839837

840838
/* restore all slots by iterating over all on-disk entries */
841839
replication_dir = AllocateDir("pg_replslot");

src/backend/utils/misc/guc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ static struct config_bool ConfigureNamesBool[] =
895895

896896
{
897897
{"wal_log_hints", PGC_POSTMASTER, WAL_SETTINGS,
898-
gettext_noop("Writes full pages to WAL when first modified after a checkpoint, even for a non-critical modifications"),
898+
gettext_noop("Writes full pages to WAL when first modified after a checkpoint, even for a non-critical modifications."),
899899
NULL
900900
},
901901
&wal_log_hints,
@@ -3483,7 +3483,7 @@ static struct config_enum ConfigureNamesEnum[] =
34833483

34843484
{
34853485
{"huge_pages", PGC_POSTMASTER, RESOURCES_MEM,
3486-
gettext_noop("Use of huge pages on Linux"),
3486+
gettext_noop("Use of huge pages on Linux."),
34873487
NULL
34883488
},
34893489
&huge_pages,
@@ -6564,7 +6564,7 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
65646564
*/
65656565
if (write(fd, buf.data, buf.len) < 0)
65666566
ereport(ERROR,
6567-
(errmsg("failed to write to \"%s\" file", filename)));
6567+
(errmsg("could not write to file \"%s\": %m", filename)));
65686568
resetStringInfo(&buf);
65696569

65706570
/*
@@ -6589,7 +6589,7 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
65896589

65906590
if (write(fd, buf.data, buf.len) < 0)
65916591
ereport(ERROR,
6592-
(errmsg("failed to write to \"%s\" file", filename)));
6592+
(errmsg("could not write to file \"%s\": %m", filename)));
65936593
resetStringInfo(&buf);
65946594
}
65956595

@@ -6792,7 +6792,7 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
67926792
if (Tmpfd < 0)
67936793
ereport(ERROR,
67946794
(errcode_for_file_access(),
6795-
errmsg("failed to open auto conf temp file \"%s\": %m ",
6795+
errmsg("could not open file \"%s\": %m",
67966796
AutoConfTmpFileName)));
67976797

67986798
PG_TRY();
@@ -6810,7 +6810,7 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
68106810
infile = AllocateFile(AutoConfFileName, "r");
68116811
if (infile == NULL)
68126812
ereport(ERROR,
6813-
(errmsg("failed to open auto conf file \"%s\": %m ",
6813+
(errmsg("could not open file \"%s\": %m",
68146814
AutoConfFileName)));
68156815

68166816
/* parse it */

0 commit comments

Comments
 (0)