Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3be97b9

Browse files
committed
Add flag values in WAL description to all heap records
Hexadecimal is consistently used as format to not bloat too much theoutput but keep it readable. This information is useful mainly fordebugging purposes with for example pg_waldump.Author: Michael PaquierReviewed-by: Nathan Bossart, Dmitry Dolgov, Andres Freund, ÁlvaroHerreraDiscussion:https://postgr.es/m/20180413034734.GE1552@paquier.xyz
1 parentb52b7dc commit3be97b9

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

‎src/backend/access/rmgrdesc/heapdesc.c

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,26 @@ heap_desc(StringInfo buf, XLogReaderState *record)
4242
{
4343
xl_heap_insert*xlrec= (xl_heap_insert*)rec;
4444

45-
appendStringInfo(buf,"off %u",xlrec->offnum);
45+
appendStringInfo(buf,"off %u flags 0x%02X",xlrec->offnum,
46+
xlrec->flags);
4647
}
4748
elseif (info==XLOG_HEAP_DELETE)
4849
{
4950
xl_heap_delete*xlrec= (xl_heap_delete*)rec;
5051

51-
appendStringInfo(buf,"off %u ",xlrec->offnum);
52+
appendStringInfo(buf,"off %u flags 0x%02X ",
53+
xlrec->offnum,
54+
xlrec->flags);
5255
out_infobits(buf,xlrec->infobits_set);
5356
}
5457
elseif (info==XLOG_HEAP_UPDATE)
5558
{
5659
xl_heap_update*xlrec= (xl_heap_update*)rec;
5760

58-
appendStringInfo(buf,"off %u xmax %u ",
61+
appendStringInfo(buf,"off %u xmax %uflags 0x%02X",
5962
xlrec->old_offnum,
60-
xlrec->old_xmax);
63+
xlrec->old_xmax,
64+
xlrec->flags);
6165
out_infobits(buf,xlrec->old_infobits_set);
6266
appendStringInfo(buf,"; new off %u xmax %u",
6367
xlrec->new_offnum,
@@ -67,9 +71,10 @@ heap_desc(StringInfo buf, XLogReaderState *record)
6771
{
6872
xl_heap_update*xlrec= (xl_heap_update*)rec;
6973

70-
appendStringInfo(buf,"off %u xmax %u ",
74+
appendStringInfo(buf,"off %u xmax %uflags 0x%02X",
7175
xlrec->old_offnum,
72-
xlrec->old_xmax);
76+
xlrec->old_xmax,
77+
xlrec->flags);
7378
out_infobits(buf,xlrec->old_infobits_set);
7479
appendStringInfo(buf,"; new off %u xmax %u",
7580
xlrec->new_offnum,
@@ -98,7 +103,7 @@ heap_desc(StringInfo buf, XLogReaderState *record)
98103
{
99104
xl_heap_lock*xlrec= (xl_heap_lock*)rec;
100105

101-
appendStringInfo(buf,"off %u: xid %u: flags%u ",
106+
appendStringInfo(buf,"off %u: xid %u: flags0x%02X ",
102107
xlrec->offnum,xlrec->locking_xid,xlrec->flags);
103108
out_infobits(buf,xlrec->infobits_set);
104109
}
@@ -139,20 +144,21 @@ heap2_desc(StringInfo buf, XLogReaderState *record)
139144
{
140145
xl_heap_visible*xlrec= (xl_heap_visible*)rec;
141146

142-
appendStringInfo(buf,"cutoff xid %u flags%d",
147+
appendStringInfo(buf,"cutoff xid %u flags0x%02X",
143148
xlrec->cutoff_xid,xlrec->flags);
144149
}
145150
elseif (info==XLOG_HEAP2_MULTI_INSERT)
146151
{
147152
xl_heap_multi_insert*xlrec= (xl_heap_multi_insert*)rec;
148153

149-
appendStringInfo(buf,"%d tuples",xlrec->ntuples);
154+
appendStringInfo(buf,"%d tuples flags 0x%02X",xlrec->ntuples,
155+
xlrec->flags);
150156
}
151157
elseif (info==XLOG_HEAP2_LOCK_UPDATED)
152158
{
153159
xl_heap_lock_updated*xlrec= (xl_heap_lock_updated*)rec;
154160

155-
appendStringInfo(buf,"off %u: xmax %u: flags%u ",
161+
appendStringInfo(buf,"off %u: xmax %u: flags0x%02X ",
156162
xlrec->offnum,xlrec->xmax,xlrec->flags);
157163
out_infobits(buf,xlrec->infobits_set);
158164
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp