1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * relmapper.h |
4 | * Catalog-to-filenode mapping |
5 | * |
6 | * |
7 | * Portions Copyright (c) 1996-2019, 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]; |
33 | } xl_relmap_update; |
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, bool isParallelWorker); |
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 Size EstimateRelationMapSpace(void); |
63 | extern void SerializeRelationMap(Size maxSize, char *startAddress); |
64 | extern void RestoreRelationMap(char *startAddress); |
65 | |
66 | extern void relmap_redo(XLogReaderState *record); |
67 | extern void relmap_desc(StringInfo buf, XLogReaderState *record); |
68 | extern const char *relmap_identify(uint8 info); |
69 | |
70 | #endif /* RELMAPPER_H */ |
71 | |