static void
XLogDumpDisplayRecord(XLogDumpConfig *config, XLogRecPtr ReadRecPtr, XLogRecord *record)
{
+ const char *id;
const RmgrDescData *desc = &RmgrDescTable[record->xl_rmid];
+ id = desc->rm_identify(record->xl_info);
+ if (id == NULL)
+ id = psprintf("UNKNOWN (%x)", record->xl_info & ~XLR_INFO_MASK);
+
printf("rmgr: %-11s len (rec/tot): %6u/%6u, tx: %10u, lsn: %X/%08X, prev %X/%08X, bkp: %u%u%u%u, desc: %s ",
desc->rm_name,
record->xl_len, record->xl_tot_len,
!!(XLR_BKP_BLOCK(1) & record->xl_info),
!!(XLR_BKP_BLOCK(2) & record->xl_info),
!!(XLR_BKP_BLOCK(3) & record->xl_info),
- desc->rm_identify(record->xl_info));
+ id);
/* the desc routine will printf the description directly to stdout */
desc->rm_desc(NULL, record);
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case CLOG_ZEROPAGE:
id = "ZEROPAGE";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_DBASE_CREATE:
id = "CREATE";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_GIN_CREATE_INDEX:
id = "CREATE_INDEX";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_GIST_PAGE_UPDATE:
id = "PAGE_UPDATE";
}
}
-static const char *
-append_init(const char *str)
-{
- static char x[32];
-
- strcpy(x, str);
- strcat(x, "+INIT");
-
- return x;
-}
-
const char *
heap_identify(uint8 info)
{
const char *id = NULL;
- switch (info & XLOG_HEAP_OPMASK)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_HEAP_INSERT:
id = "INSERT";
break;
+ case XLOG_HEAP_INSERT | XLOG_HEAP_INIT_PAGE:
+ id = "INSERT+INIT";
+ break;
case XLOG_HEAP_DELETE:
id = "DELETE";
break;
case XLOG_HEAP_UPDATE:
id = "UPDATE";
break;
+ case XLOG_HEAP_UPDATE | XLOG_HEAP_INIT_PAGE:
+ id = "UPDATE+INIT";
+ break;
case XLOG_HEAP_HOT_UPDATE:
id = "HOT_UPDATE";
break;
+ case XLOG_HEAP_HOT_UPDATE | XLOG_HEAP_INIT_PAGE:
+ id = "HOT_UPDATE+INIT";
+ break;
case XLOG_HEAP_LOCK:
id = "LOCK";
break;
break;
}
- if (info & XLOG_HEAP_INIT_PAGE)
- id = append_init(id);
-
return id;
}
{
const char *id = NULL;
- switch (info & XLOG_HEAP_OPMASK)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_HEAP2_CLEAN:
id = "CLEAN";
case XLOG_HEAP2_MULTI_INSERT:
id = "MULTI_INSERT";
break;
+ case XLOG_HEAP2_MULTI_INSERT | XLOG_HEAP_INIT_PAGE:
+ id = "MULTI_INSERT+INIT";
+ break;
case XLOG_HEAP2_LOCK_UPDATED:
id = "LOCK_UPDATED";
break;
break;
}
- if (info & XLOG_HEAP_INIT_PAGE)
- id = append_init(id);
-
return id;
}
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_MULTIXACT_ZERO_OFF_PAGE:
id = "ZERO_OFF_PAGE";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_BTREE_INSERT_LEAF:
id = "INSERT_LEAF";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_RELMAP_UPDATE:
id = "UPDATE";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_SEQ_LOG:
id = "LOG";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_SMGR_CREATE:
id = "CREATE";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_SPGIST_CREATE_INDEX:
id = "CREATE_INDEX";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_STANDBY_LOCK:
id = "LOCK";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_TBLSPC_CREATE:
id = "CREATE";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_XACT_COMMIT:
id = "COMMIT";
{
const char *id = NULL;
- switch (info)
+ switch (info & ~XLR_INFO_MASK)
{
case XLOG_CHECKPOINT_SHUTDOWN:
id = "CHECKPOINT_SHUTDOWN";
id = RmgrTable[rmid].rm_identify(record->xl_info);
if (id == NULL)
- appendStringInfo(buf, "UNKNOWN (%X): ", record->xl_info);
+ appendStringInfo(buf, "UNKNOWN (%X): ",
+ record->xl_info & ~XLR_INFO_MASK);
else
appendStringInfo(buf, "%s: ", id);
* "VACUUM". rm_desc can then be called to obtain additional detail for the
* record, if available (e.g. the last block).
*
- * The return value from rm_identify is a pointer to a statically allocated
- * buffer, and only valid until the next invocation of the callback.
- *
* RmgrTable[] is indexed by RmgrId values (see rmgrlist.h).
*/
typedef struct RmgrData