]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_am.h
Finish repairing 6.5's problems with r-tree indexes: create appropriate
[postgresql] / src / include / catalog / pg_am.h
1 /*-------------------------------------------------------------------------
2  *
3  * pg_am.h
4  *        definition of the system "am" relation (pg_am)
5  *        along with the relation's initial contents.
6  *
7  *
8  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * $Id: pg_am.h,v 1.14 2000/02/17 03:39:47 tgl 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 definintions and the
27  *              CATALOG(), 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 CATALOG(pg_am)
38 {
39         NameData        amname;                 /* access method name */
40         int4            amowner;                /* usesysid of creator */
41         int2            amstrategies;   /* total NUMBER of strategies by which
42                                                                  * we can traverse/search this AM */
43         int2            amsupport;              /* total NUMBER of support functions
44                                                                  * that this AM uses */
45         int2            amorderstrategy; /* if this AM has a sort order, the
46                                                                   * strategy number of the sort operator.
47                                                                   * Zero if AM is not ordered. */
48         regproc         amgettuple;             /* "next valid tuple" function */
49         regproc         aminsert;               /* "insert this tuple" function */
50         regproc         amdelete;               /* "delete this tuple" function */
51         regproc         amgetattr;              /* - deprecated */
52         regproc         amsetlock;              /* - deprecated */
53         regproc         amsettid;               /* - deprecated */
54         regproc         amfreetuple;    /* - deprecated */
55         regproc         ambeginscan;    /* "start new scan" function */
56         regproc         amrescan;               /* "restart this scan" function */
57         regproc         amendscan;              /* "end this scan" function */
58         regproc         ammarkpos;              /* "mark current scan position" function */
59         regproc         amrestrpos;             /* "restore marked scan position" function */
60         regproc         amopen;                 /* - deprecated */
61         regproc         amclose;                /* - deprecated */
62         regproc         ambuild;                /* "build new index" function */
63         regproc         amcreate;               /* - deprecated */
64         regproc         amdestroy;              /* - deprecated */
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                                             23
80 #define Anum_pg_am_amname                               1
81 #define Anum_pg_am_amowner                              2
82 #define Anum_pg_am_amstrategies                 3
83 #define Anum_pg_am_amsupport                    4
84 #define Anum_pg_am_amorderstrategy              5
85 #define Anum_pg_am_amgettuple                   6
86 #define Anum_pg_am_aminsert                             7
87 #define Anum_pg_am_amdelete                             8
88 #define Anum_pg_am_amgetattr                    9
89 #define Anum_pg_am_amsetlock                    10
90 #define Anum_pg_am_amsettid                             11
91 #define Anum_pg_am_amfreetuple                  12
92 #define Anum_pg_am_ambeginscan                  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_amopen                               18
98 #define Anum_pg_am_amclose                              19
99 #define Anum_pg_am_ambuild                              20
100 #define Anum_pg_am_amcreate                             21
101 #define Anum_pg_am_amdestroy                    22
102 #define Anum_pg_am_amcostestimate               23
103
104 /* ----------------
105  *              initial contents of pg_am
106  * ----------------
107  */
108
109 DATA(insert OID = 402 (  rtree PGUID 8 3 0 rtgettuple rtinsert rtdelete - - - - rtbeginscan rtrescan rtendscan rtmarkpos rtrestrpos - - rtbuild - - rtcostestimate ));
110 DESCR("");
111 DATA(insert OID = 403 (  btree PGUID 5 1 1 btgettuple btinsert btdelete - - - - btbeginscan btrescan btendscan btmarkpos btrestrpos - - btbuild - - btcostestimate ));
112 DESCR("");
113 #define BTREE_AM_OID 403
114 DATA(insert OID = 405 (  hash PGUID 1 1 0 hashgettuple hashinsert hashdelete - - - - hashbeginscan hashrescan hashendscan hashmarkpos hashrestrpos - - hashbuild - - hashcostestimate ));
115 DESCR("");
116 #define HASH_AM_OID 405
117 DATA(insert OID = 783 (  gist PGUID 100 7 0 gistgettuple gistinsert gistdelete - - - - gistbeginscan gistrescan gistendscan gistmarkpos gistrestrpos - - gistbuild - - gistcostestimate ));
118 DESCR("");
119
120 #endif   /* PG_AM_H */