Consistently use "superuser" instead of "super user"
[pgsql.git] / src / include / access / gistxlog.h
blobfd5144f25885b66a47864cde19114c496ddc7f5a
1 /*-------------------------------------------------------------------------
3 * gistxlog.h
4 * gist xlog routines
6 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/access/gistxlog.h
11 *-------------------------------------------------------------------------
13 #ifndef GIST_XLOG_H
14 #define GIST_XLOG_H
16 #include "access/gist.h"
17 #include "access/xlogreader.h"
18 #include "lib/stringinfo.h"
20 #define XLOG_GIST_PAGE_UPDATE 0x00
21 #define XLOG_GIST_DELETE 0x10 /* delete leaf index tuples for a
22 * page */
23 #define XLOG_GIST_PAGE_REUSE 0x20 /* old page is about to be reused
24 * from FSM */
25 #define XLOG_GIST_PAGE_SPLIT 0x30
26 /* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */
27 /* #define XLOG_GIST_CREATE_INDEX 0x50 */ /* not used anymore */
28 #define XLOG_GIST_PAGE_DELETE 0x60
29 #define XLOG_GIST_ASSIGN_LSN 0x70 /* nop, assign new LSN */
32 * Backup Blk 0: updated page.
33 * Backup Blk 1: If this operation completes a page split, by inserting a
34 * downlink for the split page, the left half of the split
36 typedef struct gistxlogPageUpdate
38 /* number of deleted offsets */
39 uint16 ntodelete;
40 uint16 ntoinsert;
43 * In payload of blk 0 : 1. todelete OffsetNumbers 2. tuples to insert
45 } gistxlogPageUpdate;
48 * Backup Blk 0: Leaf page, whose index tuples are deleted.
50 typedef struct gistxlogDelete
52 TransactionId latestRemovedXid;
53 uint16 ntodelete; /* number of deleted offsets */
56 * In payload of blk 0 : todelete OffsetNumbers
58 } gistxlogDelete;
60 #define SizeOfGistxlogDelete (offsetof(gistxlogDelete, ntodelete) + sizeof(uint16))
63 * Backup Blk 0: If this operation completes a page split, by inserting a
64 * downlink for the split page, the left half of the split
65 * Backup Blk 1 - npage: split pages (1 is the original page)
67 typedef struct gistxlogPageSplit
69 BlockNumber origrlink; /* rightlink of the page before split */
70 GistNSN orignsn; /* NSN of the page before split */
71 bool origleaf; /* was splitted page a leaf page? */
73 uint16 npage; /* # of pages in the split */
74 bool markfollowright; /* set F_FOLLOW_RIGHT flags */
77 * follow: 1. gistxlogPage and array of IndexTupleData per page
79 } gistxlogPageSplit;
82 * Backup Blk 0: page that was deleted.
83 * Backup Blk 1: parent page, containing the downlink to the deleted page.
85 typedef struct gistxlogPageDelete
87 FullTransactionId deleteXid; /* last Xid which could see page in scan */
88 OffsetNumber downlinkOffset; /* Offset of downlink referencing this
89 * page */
90 } gistxlogPageDelete;
92 #define SizeOfGistxlogPageDelete (offsetof(gistxlogPageDelete, downlinkOffset) + sizeof(OffsetNumber))
96 * This is what we need to know about page reuse, for hot standby.
98 typedef struct gistxlogPageReuse
100 RelFileNode node;
101 BlockNumber block;
102 FullTransactionId latestRemovedFullXid;
103 } gistxlogPageReuse;
105 #define SizeOfGistxlogPageReuse (offsetof(gistxlogPageReuse, latestRemovedFullXid) + sizeof(FullTransactionId))
107 extern void gist_redo(XLogReaderState *record);
108 extern void gist_desc(StringInfo buf, XLogReaderState *record);
109 extern const char *gist_identify(uint8 info);
110 extern void gist_xlog_startup(void);
111 extern void gist_xlog_cleanup(void);
112 extern void gist_mask(char *pagedata, BlockNumber blkno);
114 #endif