Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e392fc

Browse files
committed
Use errmsg_internal for debug messages
An inconsistent set of debug-level messages was not using errmsg_internal(), thus uselessly exposing the messages to translation work. Fix those.
1 parent e6b8e83 commit 0e392fc

File tree

30 files changed

+68
-70
lines changed

30 files changed

+68
-70
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
535535
if (metad->btm_fastroot != metad->btm_root)
536536
ereport(DEBUG1,
537537
(errcode(ERRCODE_NO_DATA),
538-
errmsg("harmless fast root mismatch in index %s",
538+
errmsg_internal("harmless fast root mismatch in index %s",
539539
RelationGetRelationName(rel)),
540540
errdetail_internal("Fast root block %u (level %u) differs from true root block %u (level %u).",
541541
metad->btm_fastroot, metad->btm_fastlevel,
@@ -721,7 +721,7 @@ bt_check_level_from_leftmost(BtreeCheckState *state, BtreeLevel level)
721721
else
722722
ereport(DEBUG1,
723723
(errcode(ERRCODE_NO_DATA),
724-
errmsg("block %u of index \"%s\" ignored",
724+
errmsg_internal("block %u of index \"%s\" ignored",
725725
current, RelationGetRelationName(state->rel))));
726726
goto nextpage;
727727
}
@@ -979,7 +979,7 @@ bt_recheck_sibling_links(BtreeCheckState *state,
979979
/* Report split in left sibling, not target (or new target) */
980980
ereport(DEBUG1,
981981
(errcode(ERRCODE_INTERNAL_ERROR),
982-
errmsg("harmless concurrent page split detected in index \"%s\"",
982+
errmsg_internal("harmless concurrent page split detected in index \"%s\"",
983983
RelationGetRelationName(state->rel)),
984984
errdetail_internal("Block=%u new right sibling=%u original right sibling=%u.",
985985
leftcurrent, newtargetblock,
@@ -1605,7 +1605,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
16051605
targetnext = opaque->btpo_next;
16061606
ereport(DEBUG1,
16071607
(errcode(ERRCODE_NO_DATA),
1608-
errmsg("level %u leftmost page of index \"%s\" was found deleted or half dead",
1608+
errmsg_internal("level %u leftmost page of index \"%s\" was found deleted or half dead",
16091609
opaque->btpo.level, RelationGetRelationName(state->rel)),
16101610
errdetail_internal("Deleted page found when building scankey from right sibling.")));
16111611

@@ -1733,7 +1733,7 @@ bt_right_page_check_scankey(BtreeCheckState *state)
17331733
*/
17341734
ereport(DEBUG1,
17351735
(errcode(ERRCODE_NO_DATA),
1736-
errmsg("%s block %u of index \"%s\" has no first data item",
1736+
errmsg_internal("%s block %u of index \"%s\" has no first data item",
17371737
P_ISLEAF(opaque) ? "leaf" : "internal", targetnext,
17381738
RelationGetRelationName(state->rel))));
17391739
return NULL;
@@ -2287,7 +2287,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
22872287
{
22882288
ereport(DEBUG1,
22892289
(errcode(ERRCODE_NO_DATA),
2290-
errmsg("harmless interrupted page split detected in index %s",
2290+
errmsg_internal("harmless interrupted page split detected in index %s",
22912291
RelationGetRelationName(state->rel)),
22922292
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
22932293
blkno, opaque->btpo.level,

contrib/pg_prewarm/autoprewarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
697697
apw_state->pid_using_dumpfile = InvalidPid;
698698

699699
ereport(DEBUG1,
700-
(errmsg("wrote block details for %d blocks", num_blocks)));
700+
(errmsg_internal("wrote block details for %d blocks", num_blocks)));
701701
return num_blocks;
702702
}
703703

src/backend/access/transam/multixact.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid,
22772277

22782278
/* Log the info */
22792279
ereport(DEBUG1,
2280-
(errmsg("MultiXactId wrap limit is %u, limited by database with OID %u",
2280+
(errmsg_internal("MultiXactId wrap limit is %u, limited by database with OID %u",
22812281
multiWrapLimit, oldest_datoid)));
22822282

22832283
/*
@@ -2611,7 +2611,7 @@ SetOffsetVacuumLimit(bool is_startup)
26112611

26122612
if (oldestOffsetKnown)
26132613
ereport(DEBUG1,
2614-
(errmsg("oldest MultiXactId member is at offset %u",
2614+
(errmsg_internal("oldest MultiXactId member is at offset %u",
26152615
oldestOffset)));
26162616
else
26172617
ereport(LOG,
@@ -2640,7 +2640,7 @@ SetOffsetVacuumLimit(bool is_startup)
26402640
(errmsg("MultiXact member wraparound protections are now enabled")));
26412641

26422642
ereport(DEBUG1,
2643-
(errmsg("MultiXact member stop limit is now %u based on MultiXact %u",
2643+
(errmsg_internal("MultiXact member stop limit is now %u based on MultiXact %u",
26442644
offsetStopLimit, oldestMultiXactId)));
26452645
}
26462646
else if (prevOldestOffsetKnown)

src/backend/access/transam/slru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ SlruInternalDeleteSegment(SlruCtl ctl, int segno)
13151315

13161316
/* Unlink the file. */
13171317
SlruFileName(ctl, path, segno);
1318-
ereport(DEBUG2, (errmsg("removing file \"%s\"", path)));
1318+
ereport(DEBUG2, (errmsg_internal("removing file \"%s\"", path)));
13191319
unlink(path);
13201320
}
13211321

src/backend/access/transam/varsup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
425425

426426
/* Log the info */
427427
ereport(DEBUG1,
428-
(errmsg("transaction ID wrap limit is %u, limited by database with OID %u",
428+
(errmsg_internal("transaction ID wrap limit is %u, limited by database with OID %u",
429429
xidWrapLimit, oldest_datoid)));
430430

431431
/*

src/backend/access/transam/xlog.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,7 +2837,7 @@ UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force)
28372837
minRecoveryPointTLI = newMinRecoveryPointTLI;
28382838

28392839
ereport(DEBUG2,
2840-
(errmsg("updated min recovery point to %X/%X on timeline %u",
2840+
(errmsg_internal("updated min recovery point to %X/%X on timeline %u",
28412841
(uint32) (minRecoveryPoint >> 32),
28422842
(uint32) minRecoveryPoint,
28432843
newMinRecoveryPointTLI)));
@@ -4209,7 +4209,7 @@ RemoveXlogFile(const char *segname, XLogSegNo recycleSegNo,
42094209
true, recycleSegNo, true))
42104210
{
42114211
ereport(DEBUG2,
4212-
(errmsg("recycled write-ahead log file \"%s\"",
4212+
(errmsg_internal("recycled write-ahead log file \"%s\"",
42134213
segname)));
42144214
CheckpointStats.ckpt_segs_recycled++;
42154215
/* Needn't recheck that slot on future iterations */
@@ -4221,7 +4221,7 @@ RemoveXlogFile(const char *segname, XLogSegNo recycleSegNo,
42214221
int rc;
42224222

42234223
ereport(DEBUG2,
4224-
(errmsg("removing write-ahead log file \"%s\"",
4224+
(errmsg_internal("removing write-ahead log file \"%s\"",
42254225
segname)));
42264226

42274227
#ifdef WIN32
@@ -6597,7 +6597,7 @@ StartupXLOG(void)
65976597
memcpy(&checkPoint, XLogRecGetData(xlogreader), sizeof(CheckPoint));
65986598
wasShutdown = ((record->xl_info & ~XLR_INFO_MASK) == XLOG_CHECKPOINT_SHUTDOWN);
65996599
ereport(DEBUG1,
6600-
(errmsg("checkpoint record is at %X/%X",
6600+
(errmsg_internal("checkpoint record is at %X/%X",
66016601
(uint32) (checkPointLoc >> 32), (uint32) checkPointLoc)));
66026602
InRecovery = true; /* force recovery even if SHUTDOWNED */
66036603

@@ -6730,7 +6730,7 @@ StartupXLOG(void)
67306730
if (record != NULL)
67316731
{
67326732
ereport(DEBUG1,
6733-
(errmsg("checkpoint record is at %X/%X",
6733+
(errmsg_internal("checkpoint record is at %X/%X",
67346734
(uint32) (checkPointLoc >> 32), (uint32) checkPointLoc)));
67356735
}
67366736
else
@@ -7118,7 +7118,7 @@ StartupXLOG(void)
71187118
int nxids;
71197119

71207120
ereport(DEBUG1,
7121-
(errmsg("initializing for hot standby")));
7121+
(errmsg_internal("initializing for hot standby")));
71227122

71237123
InitRecoveryTransactionEnvironment();
71247124

@@ -8933,7 +8933,7 @@ CreateCheckPoint(int flags)
89338933
WALInsertLockRelease();
89348934
END_CRIT_SECTION();
89358935
ereport(DEBUG1,
8936-
(errmsg("checkpoint skipped because system is idle")));
8936+
(errmsg_internal("checkpoint skipped because system is idle")));
89378937
return;
89388938
}
89398939
}
@@ -9399,7 +9399,7 @@ CreateRestartPoint(int flags)
93999399
if (!RecoveryInProgress())
94009400
{
94019401
ereport(DEBUG2,
9402-
(errmsg("skipping restartpoint, recovery has already ended")));
9402+
(errmsg_internal("skipping restartpoint, recovery has already ended")));
94039403
return false;
94049404
}
94059405

@@ -9421,7 +9421,7 @@ CreateRestartPoint(int flags)
94219421
lastCheckPoint.redo <= ControlFile->checkPointCopy.redo)
94229422
{
94239423
ereport(DEBUG2,
9424-
(errmsg("skipping restartpoint, already performed at %X/%X",
9424+
(errmsg_internal("skipping restartpoint, already performed at %X/%X",
94259425
(uint32) (lastCheckPoint.redo >> 32),
94269426
(uint32) lastCheckPoint.redo)));
94279427

@@ -11763,12 +11763,12 @@ read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired,
1176311763
*/
1176411764
if (fscanf(lfp, "START TIME: %127[^\n]\n", backuptime) == 1)
1176511765
ereport(DEBUG1,
11766-
(errmsg("backup time %s in file \"%s\"",
11766+
(errmsg_internal("backup time %s in file \"%s\"",
1176711767
backuptime, BACKUP_LABEL_FILE)));
1176811768

1176911769
if (fscanf(lfp, "LABEL: %1023[^\n]\n", backuplabel) == 1)
1177011770
ereport(DEBUG1,
11771-
(errmsg("backup label %s in file \"%s\"",
11771+
(errmsg_internal("backup label %s in file \"%s\"",
1177211772
backuplabel, BACKUP_LABEL_FILE)));
1177311773

1177411774
/*
@@ -11785,7 +11785,7 @@ read_backup_label(XLogRecPtr *checkPointLoc, bool *backupEndRequired,
1178511785
tli_from_file, tli_from_walseg)));
1178611786

1178711787
ereport(DEBUG1,
11788-
(errmsg("backup timeline %u in file \"%s\"",
11788+
(errmsg_internal("backup timeline %u in file \"%s\"",
1178911789
tli_from_file, BACKUP_LABEL_FILE)));
1179011790
}
1179111791

src/backend/catalog/dependency.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ reportDependentObjects(const ObjectAddresses *targetObjects,
11981198
* log_min_messages are different.
11991199
*/
12001200
ereport(DEBUG2,
1201-
(errmsg("drop auto-cascades to %s",
1201+
(errmsg_internal("drop auto-cascades to %s",
12021202
objDesc)));
12031203
}
12041204
else if (behavior == DROP_RESTRICT)

src/backend/catalog/index.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,14 +3081,12 @@ index_build(Relation heapRelation,
30813081

30823082
if (indexInfo->ii_ParallelWorkers == 0)
30833083
ereport(DEBUG1,
3084-
(errmsg("building index \"%s\" on table \"%s\" serially",
3084+
(errmsg_internal("building index \"%s\" on table \"%s\" serially",
30853085
RelationGetRelationName(indexRelation),
30863086
RelationGetRelationName(heapRelation))));
30873087
else
30883088
ereport(DEBUG1,
3089-
(errmsg_plural("building index \"%s\" on table \"%s\" with request for %d parallel worker",
3090-
"building index \"%s\" on table \"%s\" with request for %d parallel workers",
3091-
indexInfo->ii_ParallelWorkers,
3089+
(errmsg_internal("building index \"%s\" on table \"%s\" with request for %d parallel workers",
30923090
RelationGetRelationName(indexRelation),
30933091
RelationGetRelationName(heapRelation),
30943092
indexInfo->ii_ParallelWorkers)));

src/backend/commands/indexcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ DefineIndex(Oid relationId,
10851085
}
10861086

10871087
ereport(DEBUG1,
1088-
(errmsg("%s %s will create implicit index \"%s\" for table \"%s\"",
1088+
(errmsg_internal("%s %s will create implicit index \"%s\" for table \"%s\"",
10891089
is_alter_table ? "ALTER TABLE / ADD" : "CREATE TABLE /",
10901090
constraint_type,
10911091
indexRelationName, RelationGetRelationName(rel))));

src/backend/commands/subscriptioncmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
647647
copy_data ? SUBREL_STATE_INIT : SUBREL_STATE_READY,
648648
InvalidXLogRecPtr);
649649
ereport(DEBUG1,
650-
(errmsg("table \"%s.%s\" added to subscription \"%s\"",
650+
(errmsg_internal("table \"%s.%s\" added to subscription \"%s\"",
651651
rv->schemaname, rv->relname, sub->name)));
652652
}
653653
}
@@ -721,7 +721,7 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
721721
}
722722

723723
ereport(DEBUG1,
724-
(errmsg("table \"%s.%s\" removed from subscription \"%s\"",
724+
(errmsg_internal("table \"%s.%s\" removed from subscription \"%s\"",
725725
get_namespace_name(get_rel_namespace(relid)),
726726
get_rel_name(relid),
727727
sub->name)));

0 commit comments

Comments
 (0)