00001 /*------------------------------------------------------------------------- 00002 * 00003 * pg_am.h 00004 * definition of the system "access method" relation (pg_am) 00005 * along with the relation's initial contents. 00006 * 00007 * 00008 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00009 * Portions Copyright (c) 1994, Regents of the University of California 00010 * 00011 * src/include/catalog/pg_am.h 00012 * 00013 * NOTES 00014 * the genbki.pl script reads this file and generates .bki 00015 * information from the DATA() statements. 00016 * 00017 * XXX do NOT break up DATA() statements into multiple lines! 00018 * the scripts are not as smart as you might think... 00019 * 00020 *------------------------------------------------------------------------- 00021 */ 00022 #ifndef PG_AM_H 00023 #define PG_AM_H 00024 00025 #include "catalog/genbki.h" 00026 00027 /* ---------------- 00028 * pg_am definition. cpp turns this into 00029 * typedef struct FormData_pg_am 00030 * ---------------- 00031 */ 00032 #define AccessMethodRelationId 2601 00033 00034 CATALOG(pg_am,2601) 00035 { 00036 NameData amname; /* access method name */ 00037 int16 amstrategies; /* total number of strategies (operators) by 00038 * which we can traverse/search this AM. Zero 00039 * if AM does not have a fixed set of strategy 00040 * assignments. */ 00041 int16 amsupport; /* total number of support functions that this 00042 * AM uses */ 00043 bool amcanorder; /* does AM support order by column value? */ 00044 bool amcanorderbyop; /* does AM support order by operator result? */ 00045 bool amcanbackward; /* does AM support backward scan? */ 00046 bool amcanunique; /* does AM support UNIQUE indexes? */ 00047 bool amcanmulticol; /* does AM support multi-column indexes? */ 00048 bool amoptionalkey; /* can query omit key for the first column? */ 00049 bool amsearcharray; /* can AM handle ScalarArrayOpExpr quals? */ 00050 bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */ 00051 bool amstorage; /* can storage type differ from column type? */ 00052 bool amclusterable; /* does AM support cluster command? */ 00053 bool ampredlocks; /* does AM handle predicate locks? */ 00054 Oid amkeytype; /* type of data in index, or InvalidOid */ 00055 regproc aminsert; /* "insert this tuple" function */ 00056 regproc ambeginscan; /* "prepare for index scan" function */ 00057 regproc amgettuple; /* "next valid tuple" function, or 0 */ 00058 regproc amgetbitmap; /* "fetch all valid tuples" function, or 0 */ 00059 regproc amrescan; /* "(re)start index scan" function */ 00060 regproc amendscan; /* "end index scan" function */ 00061 regproc ammarkpos; /* "mark current scan position" function */ 00062 regproc amrestrpos; /* "restore marked scan position" function */ 00063 regproc ambuild; /* "build new index" function */ 00064 regproc ambuildempty; /* "build empty index" function */ 00065 regproc ambulkdelete; /* bulk-delete function */ 00066 regproc amvacuumcleanup; /* post-VACUUM cleanup function */ 00067 regproc amcanreturn; /* can indexscan return IndexTuples? */ 00068 regproc amcostestimate; /* estimate cost of an indexscan */ 00069 regproc amoptions; /* parse AM-specific parameters */ 00070 } FormData_pg_am; 00071 00072 /* ---------------- 00073 * Form_pg_am corresponds to a pointer to a tuple with 00074 * the format of pg_am relation. 00075 * ---------------- 00076 */ 00077 typedef FormData_pg_am *Form_pg_am; 00078 00079 /* ---------------- 00080 * compiler constants for pg_am 00081 * ---------------- 00082 */ 00083 #define Natts_pg_am 30 00084 #define Anum_pg_am_amname 1 00085 #define Anum_pg_am_amstrategies 2 00086 #define Anum_pg_am_amsupport 3 00087 #define Anum_pg_am_amcanorder 4 00088 #define Anum_pg_am_amcanorderbyop 5 00089 #define Anum_pg_am_amcanbackward 6 00090 #define Anum_pg_am_amcanunique 7 00091 #define Anum_pg_am_amcanmulticol 8 00092 #define Anum_pg_am_amoptionalkey 9 00093 #define Anum_pg_am_amsearcharray 10 00094 #define Anum_pg_am_amsearchnulls 11 00095 #define Anum_pg_am_amstorage 12 00096 #define Anum_pg_am_amclusterable 13 00097 #define Anum_pg_am_ampredlocks 14 00098 #define Anum_pg_am_amkeytype 15 00099 #define Anum_pg_am_aminsert 16 00100 #define Anum_pg_am_ambeginscan 17 00101 #define Anum_pg_am_amgettuple 18 00102 #define Anum_pg_am_amgetbitmap 19 00103 #define Anum_pg_am_amrescan 20 00104 #define Anum_pg_am_amendscan 21 00105 #define Anum_pg_am_ammarkpos 22 00106 #define Anum_pg_am_amrestrpos 23 00107 #define Anum_pg_am_ambuild 24 00108 #define Anum_pg_am_ambuildempty 25 00109 #define Anum_pg_am_ambulkdelete 26 00110 #define Anum_pg_am_amvacuumcleanup 27 00111 #define Anum_pg_am_amcanreturn 28 00112 #define Anum_pg_am_amcostestimate 29 00113 #define Anum_pg_am_amoptions 30 00114 00115 /* ---------------- 00116 * initial contents of pg_am 00117 * ---------------- 00118 */ 00119 00120 DATA(insert OID = 403 ( btree 5 2 t f t t t t t t f t t 0 btinsert btbeginscan btgettuple btgetbitmap btrescan btendscan btmarkpos btrestrpos btbuild btbuildempty btbulkdelete btvacuumcleanup btcanreturn btcostestimate btoptions )); 00121 DESCR("b-tree index access method"); 00122 #define BTREE_AM_OID 403 00123 DATA(insert OID = 405 ( hash 1 1 f f t f f f f f f f f 23 hashinsert hashbeginscan hashgettuple hashgetbitmap hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbuildempty hashbulkdelete hashvacuumcleanup - hashcostestimate hashoptions )); 00124 DESCR("hash index access method"); 00125 #define HASH_AM_OID 405 00126 DATA(insert OID = 783 ( gist 0 8 f t f f t t f t t t f 0 gistinsert gistbeginscan gistgettuple gistgetbitmap gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbuildempty gistbulkdelete gistvacuumcleanup - gistcostestimate gistoptions )); 00127 DESCR("GiST index access method"); 00128 #define GIST_AM_OID 783 00129 DATA(insert OID = 2742 ( gin 0 5 f f f f t t f f t f f 0 gininsert ginbeginscan - gingetbitmap ginrescan ginendscan ginmarkpos ginrestrpos ginbuild ginbuildempty ginbulkdelete ginvacuumcleanup - gincostestimate ginoptions )); 00130 DESCR("GIN index access method"); 00131 #define GIN_AM_OID 2742 00132 DATA(insert OID = 4000 ( spgist 0 5 f f f f f t f t f f f 0 spginsert spgbeginscan spggettuple spggetbitmap spgrescan spgendscan spgmarkpos spgrestrpos spgbuild spgbuildempty spgbulkdelete spgvacuumcleanup spgcanreturn spgcostestimate spgoptions )); 00133 DESCR("SP-GiST index access method"); 00134 #define SPGIST_AM_OID 4000 00135 00136 #endif /* PG_AM_H */