]> granicus.if.org Git - postgresql/blob - src/include/utils/syscache.h
Convert oidvector and int2vector into variable-length arrays. This
[postgresql] / src / include / utils / syscache.h
1 /*-------------------------------------------------------------------------
2  *
3  * syscache.h
4  *        System catalog cache definitions.
5  *
6  * See also lsyscache.h, which provides convenience routines for
7  * common cache-lookup operations.
8  *
9  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
10  * Portions Copyright (c) 1994, Regents of the University of California
11  *
12  * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.59 2005/03/29 00:17:18 tgl Exp $
13  *
14  *-------------------------------------------------------------------------
15  */
16 #ifndef SYSCACHE_H
17 #define SYSCACHE_H
18
19 #include "access/htup.h"
20
21 /*
22  *              Declarations for util/syscache.c.
23  *
24  *              SysCache identifiers.
25  *
26  *              The order of these must match the order
27  *              they are entered into the structure cacheinfo[] in syscache.c.
28  *              Keep them in alphabetical order.
29  */
30
31 #define AGGFNOID                0
32 #define AMNAME                  1
33 #define AMOID                   2
34 #define AMOPOPID                3
35 #define AMOPSTRATEGY    4
36 #define AMPROCNUM               5
37 #define ATTNAME                 6
38 #define ATTNUM                  7
39 #define CASTSOURCETARGET 8
40 #define CLAAMNAMENSP    9
41 #define CLAOID                  10
42 #define CONDEFAULT              11
43 #define CONNAMENSP              12
44 #define CONOID                  13
45 #define GRONAME                 14
46 #define GROSYSID                15
47 #define INDEXRELID              16
48 #define INHRELID                17
49 #define LANGNAME                18
50 #define LANGOID                 19
51 #define NAMESPACENAME   20
52 #define NAMESPACEOID    21
53 #define OPERNAMENSP             22
54 #define OPEROID                 23
55 #define PROCNAMEARGSNSP 24
56 #define PROCOID                 25
57 #define RELNAMENSP              26
58 #define RELOID                  27
59 #define RULERELNAME             28
60 #define SHADOWNAME              29
61 #define SHADOWSYSID             30
62 #define STATRELATT              31
63 #define TYPENAMENSP             32
64 #define TYPEOID                 33
65
66 extern void InitCatalogCache(void);
67 extern void InitCatalogCachePhase2(void);
68
69 extern HeapTuple SearchSysCache(int cacheId,
70                            Datum key1, Datum key2, Datum key3, Datum key4);
71 extern void ReleaseSysCache(HeapTuple tuple);
72
73 /* convenience routines */
74 extern HeapTuple SearchSysCacheCopy(int cacheId,
75                                    Datum key1, Datum key2, Datum key3, Datum key4);
76 extern bool SearchSysCacheExists(int cacheId,
77                                          Datum key1, Datum key2, Datum key3, Datum key4);
78 extern Oid GetSysCacheOid(int cacheId,
79                            Datum key1, Datum key2, Datum key3, Datum key4);
80
81 extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname);
82 extern HeapTuple SearchSysCacheCopyAttName(Oid relid, const char *attname);
83 extern bool SearchSysCacheExistsAttName(Oid relid, const char *attname);
84
85 extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
86                                 AttrNumber attributeNumber, bool *isNull);
87
88 /* list-search interface.  Users of this must import catcache.h too */
89 extern struct catclist *SearchSysCacheList(int cacheId, int nkeys,
90                                    Datum key1, Datum key2, Datum key3, Datum key4);
91
92 #define ReleaseSysCacheList(x)  ReleaseCatCacheList(x)
93
94 #endif   /* SYSCACHE_H */