~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to src/include/utils/relcache.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * relcache.h
 
4
 *        Relation descriptor cache definitions.
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
8
 * Portions Copyright (c) 1994, Regents of the University of California
 
9
 *
 
10
 * src/include/utils/relcache.h
 
11
 *
 
12
 *-------------------------------------------------------------------------
 
13
 */
 
14
#ifndef RELCACHE_H
 
15
#define RELCACHE_H
 
16
 
 
17
#include "access/tupdesc.h"
 
18
#include "nodes/bitmapset.h"
 
19
#include "nodes/pg_list.h"
 
20
 
 
21
 
 
22
typedef struct RelationData *Relation;
 
23
 
 
24
/* ----------------
 
25
 *              RelationPtr is used in the executor to support index scans
 
26
 *              where we have to keep track of several index relations in an
 
27
 *              array.  -cim 9/10/89
 
28
 * ----------------
 
29
 */
 
30
typedef Relation *RelationPtr;
 
31
 
 
32
/*
 
33
 * Routines to open (lookup) and close a relcache entry
 
34
 */
 
35
extern Relation RelationIdGetRelation(Oid relationId);
 
36
extern void RelationClose(Relation relation);
 
37
 
 
38
/*
 
39
 * Routines to compute/retrieve additional cached information
 
40
 */
 
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,
 
47
                                                 Oid **operators,
 
48
                                                 Oid **procs,
 
49
                                                 uint16 **strategies);
 
50
 
 
51
extern void RelationSetIndexList(Relation relation,
 
52
                                         List *indexIds, Oid oidIndex);
 
53
 
 
54
extern void RelationInitIndexAccessInfo(Relation relation);
 
55
 
 
56
/*
 
57
 * Routines for backend startup
 
58
 */
 
59
extern void RelationCacheInitialize(void);
 
60
extern void RelationCacheInitializePhase2(void);
 
61
extern void RelationCacheInitializePhase3(void);
 
62
 
 
63
/*
 
64
 * Routine to create a relcache entry for an about-to-be-created relation
 
65
 */
 
66
extern Relation RelationBuildLocalRelation(const char *relname,
 
67
                                                   Oid relnamespace,
 
68
                                                   TupleDesc tupDesc,
 
69
                                                   Oid relid,
 
70
                                                   Oid reltablespace,
 
71
                                                   bool shared_relation,
 
72
                                                   bool mapped_relation,
 
73
                                                   char relpersistence);
 
74
 
 
75
/*
 
76
 * Routine to manage assignment of new relfilenode to a relation
 
77
 */
 
78
extern void RelationSetNewRelfilenode(Relation relation,
 
79
                                                  TransactionId freezeXid);
 
80
 
 
81
/*
 
82
 * Routines for flushing/rebuilding relcache entries in various scenarios
 
83
 */
 
84
extern void RelationForgetRelation(Oid rid);
 
85
 
 
86
extern void RelationCacheInvalidateEntry(Oid relationId);
 
87
 
 
88
extern void RelationCacheInvalidate(void);
 
89
 
 
90
extern void RelationCloseSmgrByOid(Oid relationId);
 
91
 
 
92
extern void AtEOXact_RelationCache(bool isCommit);
 
93
extern void AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
 
94
                                                  SubTransactionId parentSubid);
 
95
 
 
96
/*
 
97
 * Routines to help manage rebuilding of relcache init files
 
98
 */
 
99
extern bool RelationIdIsInInitFile(Oid relationId);
 
100
extern void RelationCacheInitFileInvalidate(bool beforeSend);
 
101
extern void RelationCacheInitFileRemove(void);
 
102
 
 
103
/* should be used only by relcache.c and catcache.c */
 
104
extern bool criticalRelcachesBuilt;
 
105
 
 
106
/* should be used only by relcache.c and postinit.c */
 
107
extern bool criticalSharedRelcachesBuilt;
 
108
 
 
109
#endif   /* RELCACHE_H */