aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/rmgrdesc/clogdesc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/rmgrdesc/clogdesc.c')
-rw-r--r--src/backend/access/rmgrdesc/clogdesc.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/backend/access/rmgrdesc/clogdesc.c b/src/backend/access/rmgrdesc/clogdesc.c
index e82baa8d00d..8beb6d027a7 100644
--- a/src/backend/access/rmgrdesc/clogdesc.c
+++ b/src/backend/access/rmgrdesc/clogdesc.c
@@ -23,20 +23,29 @@ clog_desc(StringInfo buf, XLogRecord *record)
char *rec = XLogRecGetData(record);
uint8 info = record->xl_info & ~XLR_INFO_MASK;
- if (info == CLOG_ZEROPAGE)
+ if (info == CLOG_ZEROPAGE || info == CLOG_TRUNCATE)
{
int pageno;
memcpy(&pageno, rec, sizeof(int));
- appendStringInfo(buf, "zeropage: %d", pageno);
+ appendStringInfo(buf, "%d", pageno);
}
- else if (info == CLOG_TRUNCATE)
- {
- int pageno;
+}
- memcpy(&pageno, rec, sizeof(int));
- appendStringInfo(buf, "truncate before: %d", pageno);
+const char *
+clog_identify(uint8 info)
+{
+ const char *id = NULL;
+
+ switch (info)
+ {
+ case CLOG_ZEROPAGE:
+ id = "ZEROPAGE";
+ break;
+ case CLOG_TRUNCATE:
+ id = "TRUNCATE";
+ break;
}
- else
- appendStringInfoString(buf, "UNKNOWN");
+
+ return id;
}