]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_am.h
2cb22643280b8c8a16a8b5f44d515933d5844f72
[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-2005, 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.35 2005/06/20 10:29:37 teodor 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)
43                                                                  * by which we can traverse/search this AM */
44         int2            amsupport;              /* total NUMBER of support functions that
45                                                                  * this AM uses */
46         int2            amorderstrategy;/* if this AM has a sort order, the
47                                                                  * strategy number of the sort operator.
48                                                                  * Zero if AM is not ordered. */
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            amconcurrent;   /* does AM support concurrent updates? */
54         regproc         aminsert;               /* "insert this tuple" function */
55         regproc         ambeginscan;    /* "start new scan" function */
56         regproc         amgettuple;             /* "next valid tuple" function */
57         regproc         amgetmulti;             /* "fetch multiple tuples" function */
58         regproc         amrescan;               /* "restart this scan" function */
59         regproc         amendscan;              /* "end this scan" function */
60         regproc         ammarkpos;              /* "mark current scan position" function */
61         regproc         amrestrpos;             /* "restore marked scan position" function */
62         regproc         ambuild;                /* "build new index" function */
63         regproc         ambulkdelete;   /* bulk-delete function */
64         regproc         amvacuumcleanup;        /* post-VACUUM cleanup function */
65         regproc         amcostestimate; /* estimate cost of an indexscan */
66 } FormData_pg_am;
67
68 /* ----------------
69  *              Form_pg_am corresponds to a pointer to a tuple with
70  *              the format of pg_am relation.
71  * ----------------
72  */
73 typedef FormData_pg_am *Form_pg_am;
74
75 /* ----------------
76  *              compiler constants for pg_am
77  * ----------------
78  */
79 #define Natts_pg_am                                             21
80 #define Anum_pg_am_amname                               1
81 #define Anum_pg_am_amstrategies                 2
82 #define Anum_pg_am_amsupport                    3
83 #define Anum_pg_am_amorderstrategy              4
84 #define Anum_pg_am_amcanunique                  5
85 #define Anum_pg_am_amcanmulticol                6
86 #define Anum_pg_am_amoptionalkey                7
87 #define Anum_pg_am_amindexnulls                 8
88 #define Anum_pg_am_amconcurrent                 9
89 #define Anum_pg_am_aminsert                             10
90 #define Anum_pg_am_ambeginscan                  11
91 #define Anum_pg_am_amgettuple                   12
92 #define Anum_pg_am_amgetmulti                   13
93 #define Anum_pg_am_amrescan                             14
94 #define Anum_pg_am_amendscan                    15
95 #define Anum_pg_am_ammarkpos                    16
96 #define Anum_pg_am_amrestrpos                   17
97 #define Anum_pg_am_ambuild                              18
98 #define Anum_pg_am_ambulkdelete                 19
99 #define Anum_pg_am_amvacuumcleanup              20
100 #define Anum_pg_am_amcostestimate               21
101
102 /* ----------------
103  *              initial contents of pg_am
104  * ----------------
105  */
106
107 DATA(insert OID = 402 (  rtree  8 3 0 f f f f f rtinsert rtbeginscan rtgettuple rtgetmulti rtrescan rtendscan rtmarkpos rtrestrpos rtbuild rtbulkdelete - rtcostestimate ));
108 DESCR("r-tree index access method");
109 DATA(insert OID = 403 (  btree  5 1 1 t t t t t btinsert btbeginscan btgettuple btgetmulti btrescan btendscan btmarkpos btrestrpos btbuild btbulkdelete btvacuumcleanup btcostestimate ));
110 DESCR("b-tree index access method");
111 #define BTREE_AM_OID 403
112 DATA(insert OID = 405 (  hash   1 1 0 f f f f t hashinsert hashbeginscan hashgettuple hashgetmulti hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbulkdelete - hashcostestimate ));
113 DESCR("hash index access method");
114 #define HASH_AM_OID 405
115 DATA(insert OID = 783 (  gist   100 7 0 f t f f f gistinsert gistbeginscan gistgettuple gistgetmulti gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbulkdelete gistvacuumcleanup gistcostestimate ));
116 DESCR("GiST index access method");
117 #define GIST_AM_OID 783
118
119 #endif   /* PG_AM_H */