]> granicus.if.org Git - postgresql/blob - src/include/utils/syscache.h
Change #include's to use <> and "" as appropriate.
[postgresql] / src / include / utils / syscache.h
1 /*-------------------------------------------------------------------------
2  *
3  * syscache.h
4  *        System catalog cache definitions.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: syscache.h,v 1.15 1999/07/15 23:04:24 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef SYSCACHE_H
14 #define SYSCACHE_H
15
16 #include "access/htup.h"
17
18  /* #define CACHEDEBUG *//* turns DEBUG elogs on */
19
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  *              The best thing to do is to add yours at the END, because some
29  *              code assumes that certain caches are at certain places in this
30  *              array.
31  */
32
33 #define AMOPOPID                0
34 #define AMOPSTRATEGY    1
35 #define ATTNAME                 2
36 #define ATTNUM                  3
37 #define INDEXRELID              4
38 #define LANNAME                 5
39 #define OPRNAME                 6
40 #define OPROID                  7
41 #define PRONAME                 8
42 #define PROOID                  9
43 #define RELNAME                 10
44 #define RELOID                  11
45 #define TYPNAME                 12
46 #define TYPOID                  13
47 #define AMNAME                  14
48 #define CLANAME                 15
49 #define INDRELIDKEY             16
50 #define INHRELID                17
51 #define RULOID                  18
52 #define AGGNAME                 19
53 #define LISTENREL               20
54 #define USENAME                 21
55 #define USESYSID                22
56 #define GRONAME                 23
57 #define GROSYSID                24
58 #define REWRITENAME             25
59 #define PROSRC                  26
60 #define CLADEFTYPE              27
61 #define LANOID                  28
62
63 /* ----------------
64  *              struct cachedesc:               information needed for a call to InitSysCache()
65  * ----------------
66  */
67 struct cachedesc
68 {
69         char       *name;                       /* this is Name so that we can initialize
70                                                                  * it */
71         int                     nkeys;
72         int                     key[4];
73         int                     size;                   /* sizeof(appropriate struct) */
74         char       *indname;            /* index relation for this cache, if
75                                                                  * exists */
76         HeapTuple       (*iScanFunc) ();/* function to handle index scans */
77 };
78
79 extern void zerocaches(void);
80 extern void InitCatalogCache(void);
81 extern HeapTuple SearchSysCacheTupleCopy(int cacheId,
82                                                 Datum key1, Datum key2, Datum key3, Datum key4);
83 extern HeapTuple SearchSysCacheTuple(int cacheId,
84                                         Datum key1, Datum key2, Datum key3, Datum key4);
85 extern int32 SearchSysCacheStruct(int cacheId, char *returnStruct,
86                                          Datum key1, Datum key2, Datum key3, Datum key4);
87 extern void *SearchSysCacheGetAttribute(int cacheId,
88                                                    AttrNumber attributeNumber,
89                                                  Datum key1, Datum key2, Datum key3, Datum key4);
90 extern void *TypeDefaultRetrieve(Oid typId);
91
92 #endif   /* SYSCACHE_H */