PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
relmapper.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * relmapper.h
4  * Catalog-to-filenode mapping
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/utils/relmapper.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef RELMAPPER_H
15 #define RELMAPPER_H
16 
17 #include "access/xlogreader.h"
18 #include "lib/stringinfo.h"
19 
20 /* ----------------
21  * relmap-related XLOG entries
22  * ----------------
23  */
24 
25 #define XLOG_RELMAP_UPDATE 0x00
26 
27 typedef struct xl_relmap_update
28 {
29  Oid dbid; /* database ID, or 0 for shared map */
30  Oid tsid; /* database's tablespace, or pg_global */
31  int32 nbytes; /* size of relmap data */
32  char data[FLEXIBLE_ARRAY_MEMBER];
34 
35 #define MinSizeOfRelmapUpdate offsetof(xl_relmap_update, data)
36 
37 
38 extern Oid RelationMapOidToFilenode(Oid relationId, bool shared);
39 
40 extern Oid RelationMapFilenodeToOid(Oid relationId, bool shared);
41 
42 extern void RelationMapUpdateMap(Oid relationId, Oid fileNode, bool shared,
43  bool immediate);
44 
45 extern void RelationMapRemoveMapping(Oid relationId);
46 
47 extern void RelationMapInvalidate(bool shared);
48 extern void RelationMapInvalidateAll(void);
49 
50 extern void AtCCI_RelationMap(void);
51 extern void AtEOXact_RelationMap(bool isCommit);
52 extern void AtPrepare_RelationMap(void);
53 
54 extern void CheckPointRelationMap(void);
55 
56 extern void RelationMapFinishBootstrap(void);
57 
58 extern void RelationMapInitialize(void);
59 extern void RelationMapInitializePhase2(void);
60 extern void RelationMapInitializePhase3(void);
61 
62 extern void relmap_redo(XLogReaderState *record);
63 extern void relmap_desc(StringInfo buf, XLogReaderState *record);
64 extern const char *relmap_identify(uint8 info);
65 
66 #endif /* RELMAPPER_H */
const char * relmap_identify(uint8 info)
Definition: relmapdesc.c:35
void AtEOXact_RelationMap(bool isCommit)
Definition: relmapper.c:457
void RelationMapInitializePhase2(void)
Definition: relmapper.c:582
void RelationMapInitialize(void)
Definition: relmapper.c:562
unsigned char uint8
Definition: c.h:256
void RelationMapFinishBootstrap(void)
Definition: relmapper.c:538
unsigned int Oid
Definition: postgres_ext.h:31
signed int int32
Definition: c.h:246
void CheckPointRelationMap(void)
Definition: relmapper.c:524
Oid RelationMapFilenodeToOid(Oid relationId, bool shared)
Definition: relmapper.c:199
struct xl_relmap_update xl_relmap_update
void AtCCI_RelationMap(void)
Definition: relmapper.c:423
void RelationMapInitializePhase3(void)
Definition: relmapper.c:603
static char * buf
Definition: pg_test_fsync.c:67
void RelationMapRemoveMapping(Oid relationId)
Definition: relmapper.c:357
void RelationMapInvalidate(bool shared)
Definition: relmapper.c:387
void relmap_redo(XLogReaderState *record)
Definition: relmapper.c:908
void RelationMapUpdateMap(Oid relationId, Oid fileNode, bool shared, bool immediate)
Definition: relmapper.c:248
Oid RelationMapOidToFilenode(Oid relationId, bool shared)
Definition: relmapper.c:146
void relmap_desc(StringInfo buf, XLogReaderState *record)
Definition: relmapdesc.c:20
char data[FLEXIBLE_ARRAY_MEMBER]
Definition: relmapper.h:32
void AtPrepare_RelationMap(void)
Definition: relmapper.c:501
void RelationMapInvalidateAll(void)
Definition: relmapper.c:409