PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
gistdesc.c File Reference
#include "postgres.h"
#include "access/gistxlog.h"
#include "lib/stringinfo.h"
#include "storage/relfilenode.h"
Include dependency graph for gistdesc.c:

Go to the source code of this file.

Functions

static void out_gistxlogPageUpdate (StringInfo buf, gistxlogPageUpdate *xlrec)
 
static void out_gistxlogPageSplit (StringInfo buf, gistxlogPageSplit *xlrec)
 
void gist_desc (StringInfo buf, XLogReaderState *record)
 
const char * gist_identify (uint8 info)
 

Function Documentation

void gist_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 34 of file gistdesc.c.

References out_gistxlogPageSplit(), out_gistxlogPageUpdate(), XLOG_GIST_CREATE_INDEX, XLOG_GIST_PAGE_SPLIT, XLOG_GIST_PAGE_UPDATE, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.

35 {
36  char *rec = XLogRecGetData(record);
37  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
38 
39  switch (info)
40  {
43  break;
46  break;
48  break;
49  }
50 }
static void out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
Definition: gistdesc.c:27
unsigned char uint8
Definition: c.h:256
#define XLOG_GIST_CREATE_INDEX
Definition: gistxlog.h:24
#define XLogRecGetData(decoder)
Definition: xlogreader.h:226
#define XLOG_GIST_PAGE_SPLIT
Definition: gistxlog.h:22
static void out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
Definition: gistdesc.c:22
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:222
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_GIST_PAGE_UPDATE
Definition: gistxlog.h:20
const char* gist_identify ( uint8  info)

Definition at line 53 of file gistdesc.c.

References XLOG_GIST_CREATE_INDEX, XLOG_GIST_PAGE_SPLIT, XLOG_GIST_PAGE_UPDATE, and XLR_INFO_MASK.

54 {
55  const char *id = NULL;
56 
57  switch (info & ~XLR_INFO_MASK)
58  {
60  id = "PAGE_UPDATE";
61  break;
63  id = "PAGE_SPLIT";
64  break;
66  id = "CREATE_INDEX";
67  break;
68  }
69 
70  return id;
71 }
#define XLOG_GIST_CREATE_INDEX
Definition: gistxlog.h:24
#define XLOG_GIST_PAGE_SPLIT
Definition: gistxlog.h:22
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_GIST_PAGE_UPDATE
Definition: gistxlog.h:20
static void out_gistxlogPageSplit ( StringInfo  buf,
gistxlogPageSplit xlrec 
)
static

Definition at line 27 of file gistdesc.c.

References appendStringInfo(), and gistxlogPageSplit::npage.

Referenced by gist_desc().

28 {
29  appendStringInfo(buf, "page_split: splits to %d pages",
30  xlrec->npage);
31 }
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
static void out_gistxlogPageUpdate ( StringInfo  buf,
gistxlogPageUpdate xlrec 
)
static

Definition at line 22 of file gistdesc.c.

Referenced by gist_desc().

23 {
24 }