1 /*-------------------------------------------------------------------------
4 * System catalog cache definitions.
6 * See also lsyscache.h, which provides convenience routines for
7 * common cache-lookup operations.
9 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
10 * Portions Copyright (c) 1994, Regents of the University of California
12 * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.59 2005/03/29 00:17:18 tgl Exp $
14 *-------------------------------------------------------------------------
19 #include "access/htup.h"
22 * Declarations for util/syscache.c.
24 * SysCache identifiers.
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.
35 #define AMOPSTRATEGY 4
39 #define CASTSOURCETARGET 8
40 #define CLAAMNAMENSP 9
51 #define NAMESPACENAME 20
52 #define NAMESPACEOID 21
53 #define OPERNAMENSP 22
55 #define PROCNAMEARGSNSP 24
59 #define RULERELNAME 28
61 #define SHADOWSYSID 30
63 #define TYPENAMENSP 32
66 extern void InitCatalogCache(void);
67 extern void InitCatalogCachePhase2(void);
69 extern HeapTuple SearchSysCache(int cacheId,
70 Datum key1, Datum key2, Datum key3, Datum key4);
71 extern void ReleaseSysCache(HeapTuple tuple);
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);
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);
85 extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
86 AttrNumber attributeNumber, bool *isNull);
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);
92 #define ReleaseSysCacheList(x) ReleaseCatCacheList(x)
94 #endif /* SYSCACHE_H */