1
/*-------------------------------------------------------------------------
4
* Relation descriptor cache definitions.
7
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
10
* src/include/utils/relcache.h
12
*-------------------------------------------------------------------------
17
#include "access/tupdesc.h"
18
#include "nodes/bitmapset.h"
19
#include "nodes/pg_list.h"
22
typedef struct RelationData *Relation;
25
* RelationPtr is used in the executor to support index scans
26
* where we have to keep track of several index relations in an
30
typedef Relation *RelationPtr;
33
* Routines to open (lookup) and close a relcache entry
35
extern Relation RelationIdGetRelation(Oid relationId);
36
extern void RelationClose(Relation relation);
39
* Routines to compute/retrieve additional cached information
41
extern List *RelationGetIndexList(Relation relation);
42
extern Oid RelationGetOidIndex(Relation relation);
43
extern List *RelationGetIndexExpressions(Relation relation);
44
extern List *RelationGetIndexPredicate(Relation relation);
45
extern Bitmapset *RelationGetIndexAttrBitmap(Relation relation);
46
extern void RelationGetExclusionInfo(Relation indexRelation,
51
extern void RelationSetIndexList(Relation relation,
52
List *indexIds, Oid oidIndex);
54
extern void RelationInitIndexAccessInfo(Relation relation);
57
* Routines for backend startup
59
extern void RelationCacheInitialize(void);
60
extern void RelationCacheInitializePhase2(void);
61
extern void RelationCacheInitializePhase3(void);
64
* Routine to create a relcache entry for an about-to-be-created relation
66
extern Relation RelationBuildLocalRelation(const char *relname,
76
* Routine to manage assignment of new relfilenode to a relation
78
extern void RelationSetNewRelfilenode(Relation relation,
79
TransactionId freezeXid);
82
* Routines for flushing/rebuilding relcache entries in various scenarios
84
extern void RelationForgetRelation(Oid rid);
86
extern void RelationCacheInvalidateEntry(Oid relationId);
88
extern void RelationCacheInvalidate(void);
90
extern void RelationCloseSmgrByOid(Oid relationId);
92
extern void AtEOXact_RelationCache(bool isCommit);
93
extern void AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
94
SubTransactionId parentSubid);
97
* Routines to help manage rebuilding of relcache init files
99
extern bool RelationIdIsInInitFile(Oid relationId);
100
extern void RelationCacheInitFileInvalidate(bool beforeSend);
101
extern void RelationCacheInitFileRemove(void);
103
/* should be used only by relcache.c and catcache.c */
104
extern bool criticalRelcachesBuilt;
106
/* should be used only by relcache.c and postinit.c */
107
extern bool criticalSharedRelcachesBuilt;
109
#endif /* RELCACHE_H */