PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
gistdesc.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * gistdesc.c
4  * rmgr descriptor routines for access/gist/gistxlog.c
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  * src/backend/access/rmgrdesc/gistdesc.c
12  *
13  *-------------------------------------------------------------------------
14  */
15 #include "postgres.h"
16 
17 #include "access/gistxlog.h"
18 #include "lib/stringinfo.h"
19 #include "storage/relfilenode.h"
20 
21 static void
23 {
24 }
25 
26 static void
28 {
29  appendStringInfo(buf, "page_split: splits to %d pages",
30  xlrec->npage);
31 }
32 
33 void
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 }
51 
52 const char *
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 }
static void out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
Definition: gistdesc.c:27
unsigned char uint8
Definition: c.h:266
#define XLOG_GIST_CREATE_INDEX
Definition: gistxlog.h:24
#define XLogRecGetData(decoder)
Definition: xlogreader.h:218
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:110
#define XLOG_GIST_PAGE_SPLIT
Definition: gistxlog.h:22
static void out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
Definition: gistdesc.c:22
static char * buf
Definition: pg_test_fsync.c:66
void gist_desc(StringInfo buf, XLogReaderState *record)
Definition: gistdesc.c:34
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:214
const char * gist_identify(uint8 info)
Definition: gistdesc.c:53
#define NULL
Definition: c.h:229
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_GIST_PAGE_UPDATE
Definition: gistxlog.h:20