]> granicus.if.org Git - postgresql/blob - src/include/utils/syscache.h
Commit to match discussed elog() changes. Only update is that LOG is
[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-2001, PostgreSQL Global Development Group
10  * Portions Copyright (c) 1994, Regents of the University of California
11  *
12  * $Id: syscache.h,v 1.37 2002/02/19 20:11:20 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 AGGNAME                 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 CLAAMNAME               8
40 #define CLAOID                  9
41 #define GRONAME                 10
42 #define GROSYSID                11
43 #define INDEXRELID              12
44 #define INHRELID                13
45 #define LANGNAME                14
46 #define LANGOID                 15
47 #define OPERNAME                16
48 #define OPEROID                 17
49 #define PROCNAME                18
50 #define PROCOID                 19
51 #define RELNAME                 20
52 #define RELOID                  21
53 #define RULENAME                22
54 #define SHADOWNAME              23
55 #define SHADOWSYSID             24
56 #define STATRELATT              25
57 #define TYPENAME                26
58 #define TYPEOID                 27
59
60 extern void InitCatalogCache(void);
61 extern void InitCatalogCachePhase2(void);
62
63 extern HeapTuple SearchSysCache(int cacheId,
64                            Datum key1, Datum key2, Datum key3, Datum key4);
65 extern void ReleaseSysCache(HeapTuple tuple);
66
67 /* convenience routines */
68 extern HeapTuple SearchSysCacheCopy(int cacheId,
69                                    Datum key1, Datum key2, Datum key3, Datum key4);
70 extern bool SearchSysCacheExists(int cacheId,
71                                          Datum key1, Datum key2, Datum key3, Datum key4);
72 extern Oid GetSysCacheOid(int cacheId,
73                            Datum key1, Datum key2, Datum key3, Datum key4);
74
75 extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
76                                 AttrNumber attributeNumber, bool *isNull);
77
78 #endif   /* SYSCACHE_H */