]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_am.h
874777607edead078d242c67700906ad7079316f
[postgresql] / src / include / catalog / pg_am.h
1 /*-------------------------------------------------------------------------
2  *
3  * pg_am.h
4  *        definition of the system "access method" relation (pg_am)
5  *        along with the relation's initial contents.
6  *
7  *
8  * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * $PostgreSQL: pgsql/src/include/catalog/pg_am.h,v 1.52 2007/11/15 21:14:42 momjian Exp $
12  *
13  * NOTES
14  *              the genbki.sh script reads this file and generates .bki
15  *              information from the DATA() statements.
16  *
17  *              XXX do NOT break up DATA() statements into multiple lines!
18  *                      the scripts are not as smart as you might think...
19  *
20  *-------------------------------------------------------------------------
21  */
22 #ifndef PG_AM_H
23 #define PG_AM_H
24
25 /* ----------------
26  *              postgres.h contains the system type definitions and the
27  *              CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
28  *              can be read by both genbki.sh and the C compiler.
29  * ----------------
30  */
31
32 /* ----------------
33  *              pg_am definition.  cpp turns this into
34  *              typedef struct FormData_pg_am
35  * ----------------
36  */
37 #define AccessMethodRelationId  2601
38
39 CATALOG(pg_am,2601)
40 {
41         NameData        amname;                 /* access method name */
42         int2            amstrategies;   /* total number of strategies (operators) by
43                                                                  * which we can traverse/search this AM. Zero
44                                                                  * if AM does not have a fixed set of strategy
45                                                                  * assignments. */
46         int2            amsupport;              /* total number of support functions that this
47                                                                  * AM uses */
48         bool            amcanorder;             /* does AM support ordered scan results? */
49         bool            amcanunique;    /* does AM support UNIQUE indexes? */
50         bool            amcanmulticol;  /* does AM support multi-column indexes? */
51         bool            amoptionalkey;  /* can query omit key for the first column? */
52         bool            amindexnulls;   /* does AM support NULL index entries? */
53         bool            amsearchnulls;  /* can AM search for NULL index entries? */
54         bool            amstorage;              /* can storage type differ from column type? */
55         bool            amclusterable;  /* does AM support cluster command? */
56         regproc         aminsert;               /* "insert this tuple" function */
57         regproc         ambeginscan;    /* "start new scan" function */
58         regproc         amgettuple;             /* "next valid tuple" function */
59         regproc         amgetmulti;             /* "fetch multiple tuples" function */
60         regproc         amrescan;               /* "restart this scan" function */
61         regproc         amendscan;              /* "end this scan" function */
62         regproc         ammarkpos;              /* "mark current scan position" function */
63         regproc         amrestrpos;             /* "restore marked scan position" function */
64         regproc         ambuild;                /* "build new index" function */
65         regproc         ambulkdelete;   /* bulk-delete function */
66         regproc         amvacuumcleanup;        /* post-VACUUM cleanup function */
67         regproc         amcostestimate; /* estimate cost of an indexscan */
68         regproc         amoptions;              /* parse AM-specific parameters */
69 } FormData_pg_am;
70
71 /* ----------------
72  *              Form_pg_am corresponds to a pointer to a tuple with
73  *              the format of pg_am relation.
74  * ----------------
75  */
76 typedef FormData_pg_am *Form_pg_am;
77
78 /* ----------------
79  *              compiler constants for pg_am
80  * ----------------
81  */
82 #define Natts_pg_am                                             24
83 #define Anum_pg_am_amname                               1
84 #define Anum_pg_am_amstrategies                 2
85 #define Anum_pg_am_amsupport                    3
86 #define Anum_pg_am_amcanorder                   4
87 #define Anum_pg_am_amcanunique                  5
88 #define Anum_pg_am_amcanmulticol                6
89 #define Anum_pg_am_amoptionalkey                7
90 #define Anum_pg_am_amindexnulls                 8
91 #define Anum_pg_am_amsearchnulls                9
92 #define Anum_pg_am_amstorage                    10
93 #define Anum_pg_am_amclusterable                11
94 #define Anum_pg_am_aminsert                             12
95 #define Anum_pg_am_ambeginscan                  13
96 #define Anum_pg_am_amgettuple                   14
97 #define Anum_pg_am_amgetmulti                   15
98 #define Anum_pg_am_amrescan                             16
99 #define Anum_pg_am_amendscan                    17
100 #define Anum_pg_am_ammarkpos                    18
101 #define Anum_pg_am_amrestrpos                   19
102 #define Anum_pg_am_ambuild                              20
103 #define Anum_pg_am_ambulkdelete                 21
104 #define Anum_pg_am_amvacuumcleanup              22
105 #define Anum_pg_am_amcostestimate               23
106 #define Anum_pg_am_amoptions                    24
107
108 /* ----------------
109  *              initial contents of pg_am
110  * ----------------
111  */
112
113 DATA(insert OID = 403 (  btree  5 1 t t t t t t f t btinsert btbeginscan btgettuple btgetmulti btrescan btendscan btmarkpos btrestrpos btbuild btbulkdelete btvacuumcleanup btcostestimate btoptions ));
114 DESCR("b-tree index access method");
115 #define BTREE_AM_OID 403
116 DATA(insert OID = 405 (  hash   1 1 f f f f f f f f hashinsert hashbeginscan hashgettuple hashgetmulti hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbulkdelete hashvacuumcleanup hashcostestimate hashoptions ));
117 DESCR("hash index access method");
118 #define HASH_AM_OID 405
119 DATA(insert OID = 783 (  gist   0 7 f f t t t t t t gistinsert gistbeginscan gistgettuple gistgetmulti gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbulkdelete gistvacuumcleanup gistcostestimate gistoptions ));
120 DESCR("GiST index access method");
121 #define GIST_AM_OID 783
122 DATA(insert OID = 2742 (  gin   0 4 f f f f f f t f gininsert ginbeginscan gingettuple gingetmulti ginrescan ginendscan ginmarkpos ginrestrpos ginbuild ginbulkdelete ginvacuumcleanup gincostestimate ginoptions ));
123 DESCR("GIN index access method");
124 #define GIN_AM_OID 2742
125
126 #endif   /* PG_AM_H */