PostgreSQL Source Code  git master
committsdesc.c File Reference
#include "postgres.h"
#include "access/commit_ts.h"
Include dependency graph for committsdesc.c:

Go to the source code of this file.

Functions

void commit_ts_desc (StringInfo buf, XLogReaderState *record)
 
const char * commit_ts_identify (uint8 info)
 

Function Documentation

◆ commit_ts_desc()

void commit_ts_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 21 of file committsdesc.c.

22 {
23  char *rec = XLogRecGetData(record);
24  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
25 
26  if (info == COMMIT_TS_ZEROPAGE)
27  {
28  int64 pageno;
29 
30  memcpy(&pageno, rec, sizeof(pageno));
31  appendStringInfo(buf, "%lld", (long long) pageno);
32  }
33  else if (info == COMMIT_TS_TRUNCATE)
34  {
36 
37  appendStringInfo(buf, "pageno %lld, oldestXid %u",
38  (long long) trunc->pageno, trunc->oldestXid);
39  }
40 }
unsigned char uint8
Definition: c.h:491
#define COMMIT_TS_ZEROPAGE
Definition: commit_ts.h:46
#define COMMIT_TS_TRUNCATE
Definition: commit_ts.h:47
static char * buf
Definition: pg_test_fsync.c:73
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:97
TransactionId oldestXid
Definition: commit_ts.h:63
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:410
#define XLogRecGetData(decoder)
Definition: xlogreader.h:415
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

References appendStringInfo(), buf, COMMIT_TS_TRUNCATE, COMMIT_TS_ZEROPAGE, xl_commit_ts_truncate::oldestXid, xl_commit_ts_truncate::pageno, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.

◆ commit_ts_identify()

const char* commit_ts_identify ( uint8  info)

Definition at line 43 of file committsdesc.c.

44 {
45  switch (info)
46  {
47  case COMMIT_TS_ZEROPAGE:
48  return "ZEROPAGE";
49  case COMMIT_TS_TRUNCATE:
50  return "TRUNCATE";
51  default:
52  return NULL;
53  }
54 }

References COMMIT_TS_TRUNCATE, and COMMIT_TS_ZEROPAGE.