PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
relmapdesc.c File Reference
#include "postgres.h"
#include "utils/relmapper.h"
Include dependency graph for relmapdesc.c:

Go to the source code of this file.

Functions

void relmap_desc (StringInfo buf, XLogReaderState *record)
 
const char * relmap_identify (uint8 info)
 

Function Documentation

void relmap_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 20 of file relmapdesc.c.

References appendStringInfo(), xl_relmap_update::dbid, xl_relmap_update::nbytes, xl_relmap_update::tsid, XLOG_RELMAP_UPDATE, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.

21 {
22  char *rec = XLogRecGetData(record);
23  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
24 
25  if (info == XLOG_RELMAP_UPDATE)
26  {
27  xl_relmap_update *xlrec = (xl_relmap_update *) rec;
28 
29  appendStringInfo(buf, "database %u tablespace %u size %u",
30  xlrec->dbid, xlrec->tsid, xlrec->nbytes);
31  }
32 }
unsigned char uint8
Definition: c.h:266
#define XLogRecGetData(decoder)
Definition: xlogreader.h:218
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:110
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:214
#define XLOG_RELMAP_UPDATE
Definition: relmapper.h:25
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
const char* relmap_identify ( uint8  info)

Definition at line 35 of file relmapdesc.c.

References NULL, XLOG_RELMAP_UPDATE, and XLR_INFO_MASK.

36 {
37  const char *id = NULL;
38 
39  switch (info & ~XLR_INFO_MASK)
40  {
41  case XLOG_RELMAP_UPDATE:
42  id = "UPDATE";
43  break;
44  }
45 
46  return id;
47 }
#define XLOG_RELMAP_UPDATE
Definition: relmapper.h:25
#define NULL
Definition: c.h:229
#define XLR_INFO_MASK
Definition: xlogrecord.h:62