]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_am.h
ddacdf274c49ac7e83b941aa983dbf96214f5812
[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-2011, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * src/include/catalog/pg_am.h
12  *
13  * NOTES
14  *              the genbki.pl 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 #include "catalog/genbki.h"
26
27 /* ----------------
28  *              pg_am definition.  cpp turns this into
29  *              typedef struct FormData_pg_am
30  * ----------------
31  */
32 #define AccessMethodRelationId  2601
33
34 CATALOG(pg_am,2601)
35 {
36         NameData        amname;                 /* access method name */
37         int2            amstrategies;   /* total number of strategies (operators) by
38                                                                  * which we can traverse/search this AM. Zero
39                                                                  * if AM does not have a fixed set of strategy
40                                                                  * assignments. */
41         int2            amsupport;              /* total number of support functions that this
42                                                                  * AM uses */
43         bool            amcanorder;             /* does AM support order by column value? */
44         bool            amcanorderbyop; /* does AM support order by operator result? */
45         bool            amcanbackward;  /* does AM support backward scan? */
46         bool            amcanunique;    /* does AM support UNIQUE indexes? */
47         bool            amcanmulticol;  /* does AM support multi-column indexes? */
48         bool            amcanreturn;    /* can AM return IndexTuples? */
49         bool            amoptionalkey;  /* can query omit key for the first column? */
50         bool            amsearcharray;  /* can AM handle ScalarArrayOpExpr quals? */
51         bool            amsearchnulls;  /* can AM search for NULL/NOT NULL entries? */
52         bool            amstorage;              /* can storage type differ from column type? */
53         bool            amclusterable;  /* does AM support cluster command? */
54         bool            ampredlocks;    /* does AM handle predicate locks? */
55         Oid                     amkeytype;              /* type of data in index, or InvalidOid */
56         regproc         aminsert;               /* "insert this tuple" function */
57         regproc         ambeginscan;    /* "prepare for index scan" function */
58         regproc         amgettuple;             /* "next valid tuple" function, or 0 */
59         regproc         amgetbitmap;    /* "fetch all valid tuples" function, or 0 */
60         regproc         amrescan;               /* "(re)start index scan" function */
61         regproc         amendscan;              /* "end index 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         ambuildempty;   /* "build empty index" function */
66         regproc         ambulkdelete;   /* bulk-delete function */
67         regproc         amvacuumcleanup;        /* post-VACUUM cleanup function */
68         regproc         amcostestimate; /* estimate cost of an indexscan */
69         regproc         amoptions;              /* parse AM-specific parameters */
70 } FormData_pg_am;
71
72 /* ----------------
73  *              Form_pg_am corresponds to a pointer to a tuple with
74  *              the format of pg_am relation.
75  * ----------------
76  */
77 typedef FormData_pg_am *Form_pg_am;
78
79 /* ----------------
80  *              compiler constants for pg_am
81  * ----------------
82  */
83 #define Natts_pg_am                                             30
84 #define Anum_pg_am_amname                               1
85 #define Anum_pg_am_amstrategies                 2
86 #define Anum_pg_am_amsupport                    3
87 #define Anum_pg_am_amcanorder                   4
88 #define Anum_pg_am_amcanorderbyop               5
89 #define Anum_pg_am_amcanbackward                6
90 #define Anum_pg_am_amcanunique                  7
91 #define Anum_pg_am_amcanmulticol                8
92 #define Anum_pg_am_amcanreturn                  9
93 #define Anum_pg_am_amoptionalkey                10
94 #define Anum_pg_am_amsearcharray                11
95 #define Anum_pg_am_amsearchnulls                12
96 #define Anum_pg_am_amstorage                    13
97 #define Anum_pg_am_amclusterable                14
98 #define Anum_pg_am_ampredlocks                  15
99 #define Anum_pg_am_amkeytype                    16
100 #define Anum_pg_am_aminsert                             17
101 #define Anum_pg_am_ambeginscan                  18
102 #define Anum_pg_am_amgettuple                   19
103 #define Anum_pg_am_amgetbitmap                  20
104 #define Anum_pg_am_amrescan                             21
105 #define Anum_pg_am_amendscan                    22
106 #define Anum_pg_am_ammarkpos                    23
107 #define Anum_pg_am_amrestrpos                   24
108 #define Anum_pg_am_ambuild                              25
109 #define Anum_pg_am_ambuildempty                 26
110 #define Anum_pg_am_ambulkdelete                 27
111 #define Anum_pg_am_amvacuumcleanup              28
112 #define Anum_pg_am_amcostestimate               29
113 #define Anum_pg_am_amoptions                    30
114
115 /* ----------------
116  *              initial contents of pg_am
117  * ----------------
118  */
119
120 DATA(insert OID = 403 (  btree  5 2 t f t t t t t t t f t t 0 btinsert btbeginscan btgettuple btgetbitmap btrescan btendscan btmarkpos btrestrpos btbuild btbuildempty btbulkdelete btvacuumcleanup btcostestimate btoptions ));
121 DESCR("b-tree index access method");
122 #define BTREE_AM_OID 403
123 DATA(insert OID = 405 (  hash   1 1 f f t f f f f f f f f f 23 hashinsert hashbeginscan hashgettuple hashgetbitmap hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbuildempty hashbulkdelete hashvacuumcleanup hashcostestimate hashoptions ));
124 DESCR("hash index access method");
125 #define HASH_AM_OID 405
126 DATA(insert OID = 783 (  gist   0 8 f t f f t f t f t t t f 0 gistinsert gistbeginscan gistgettuple gistgetbitmap gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbuildempty gistbulkdelete gistvacuumcleanup gistcostestimate gistoptions ));
127 DESCR("GiST index access method");
128 #define GIST_AM_OID 783
129 DATA(insert OID = 2742 (  gin   0 5 f f f f t f t f f t f f 0 gininsert ginbeginscan - gingetbitmap ginrescan ginendscan ginmarkpos ginrestrpos ginbuild ginbuildempty ginbulkdelete ginvacuumcleanup gincostestimate ginoptions ));
130 DESCR("GIN index access method");
131 #define GIN_AM_OID 2742
132
133 #endif   /* PG_AM_H */