1 /*-------------------------------------------------------------------------
4 * This file provides some definitions to support indexing
8 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * $PostgreSQL: pgsql/src/include/catalog/indexing.h,v 1.88 2005/06/28 05:09:04 tgl Exp $
13 *-------------------------------------------------------------------------
18 #include "access/htup.h"
22 * The state object used by CatalogOpenIndexes and friends is actually the
23 * same as the executor's ResultRelInfo, but we give it another type name
24 * to decouple callers from that fact.
26 typedef struct ResultRelInfo *CatalogIndexState;
29 * indexing.c prototypes
31 extern CatalogIndexState CatalogOpenIndexes(Relation heapRel);
32 extern void CatalogCloseIndexes(CatalogIndexState indstate);
33 extern void CatalogIndexInsert(CatalogIndexState indstate,
35 extern void CatalogUpdateIndexes(Relation heapRel, HeapTuple heapTuple);
39 * These macros are just to keep the C compiler from spitting up on the
40 * upcoming commands for genbki.sh.
42 #define DECLARE_INDEX(name,oid,decl) extern int no_such_variable
43 #define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable
48 * What follows are lines processed by genbki.sh to create the statements
49 * the bootstrap parser will turn into DefineIndex commands.
51 * The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX. The first two
52 * arguments are the index name and OID, the rest is much like a standard
53 * 'create index' SQL command.
55 * For each index, we also provide a #define for its OID. References to
56 * the index in the C code should always use these #defines, not the actual
57 * index name (much less the numeric OID).
60 DECLARE_UNIQUE_INDEX(pg_aggregate_fnoid_index,2650, on pg_aggregate using btree(aggfnoid oid_ops));
61 #define AggregateFnoidIndexId 2650
63 DECLARE_UNIQUE_INDEX(pg_am_name_index,2651, on pg_am using btree(amname name_ops));
64 #define AmNameIndexId 2651
65 DECLARE_UNIQUE_INDEX(pg_am_oid_index,2652, on pg_am using btree(oid oid_ops));
66 #define AmOidIndexId 2652
68 DECLARE_UNIQUE_INDEX(pg_amop_opc_strat_index,2653, on pg_amop using btree(amopclaid oid_ops, amopsubtype oid_ops, amopstrategy int2_ops));
69 #define AccessMethodStrategyIndexId 2653
70 DECLARE_UNIQUE_INDEX(pg_amop_opr_opc_index,2654, on pg_amop using btree(amopopr oid_ops, amopclaid oid_ops));
71 #define AccessMethodOperatorIndexId 2654
73 DECLARE_UNIQUE_INDEX(pg_amproc_opc_proc_index,2655, on pg_amproc using btree(amopclaid oid_ops, amprocsubtype oid_ops, amprocnum int2_ops));
74 #define AccessMethodProcedureIndexId 2655
76 DECLARE_UNIQUE_INDEX(pg_attrdef_adrelid_adnum_index,2656, on pg_attrdef using btree(adrelid oid_ops, adnum int2_ops));
77 #define AttrDefaultIndexId 2656
78 DECLARE_UNIQUE_INDEX(pg_attrdef_oid_index,2657, on pg_attrdef using btree(oid oid_ops));
79 #define AttrDefaultOidIndexId 2657
81 DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index,2658, on pg_attribute using btree(attrelid oid_ops, attname name_ops));
82 #define AttributeRelidNameIndexId 2658
83 DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnum_index,2659, on pg_attribute using btree(attrelid oid_ops, attnum int2_ops));
84 #define AttributeRelidNumIndexId 2659
86 DECLARE_UNIQUE_INDEX(pg_authid_rolname_index,2676, on pg_authid using btree(rolname name_ops));
87 #define AuthIdRolnameIndexId 2676
88 DECLARE_UNIQUE_INDEX(pg_authid_oid_index,2677, on pg_authid using btree(oid oid_ops));
89 #define AuthIdOidIndexId 2677
91 DECLARE_UNIQUE_INDEX(pg_auth_members_role_member_index,2694, on pg_auth_members using btree(roleid oid_ops, member oid_ops));
92 #define AuthMemRoleMemIndexId 2694
93 DECLARE_UNIQUE_INDEX(pg_auth_members_member_role_index,2695, on pg_auth_members using btree(member oid_ops, roleid oid_ops));
94 #define AuthMemMemRoleIndexId 2695
96 DECLARE_UNIQUE_INDEX(pg_cast_oid_index,2660, on pg_cast using btree(oid oid_ops));
97 #define CastOidIndexId 2660
98 DECLARE_UNIQUE_INDEX(pg_cast_source_target_index,2661, on pg_cast using btree(castsource oid_ops, casttarget oid_ops));
99 #define CastSourceTargetIndexId 2661
101 DECLARE_UNIQUE_INDEX(pg_class_oid_index,2662, on pg_class using btree(oid oid_ops));
102 #define ClassOidIndexId 2662
103 DECLARE_UNIQUE_INDEX(pg_class_relname_nsp_index,2663, on pg_class using btree(relname name_ops, relnamespace oid_ops));
104 #define ClassNameNspIndexId 2663
106 /* This following index is not used for a cache and is not unique */
107 DECLARE_INDEX(pg_constraint_conname_nsp_index,2664, on pg_constraint using btree(conname name_ops, connamespace oid_ops));
108 #define ConstraintNameNspIndexId 2664
109 /* This following index is not used for a cache and is not unique */
110 DECLARE_INDEX(pg_constraint_conrelid_index,2665, on pg_constraint using btree(conrelid oid_ops));
111 #define ConstraintRelidIndexId 2665
112 /* This following index is not used for a cache and is not unique */
113 DECLARE_INDEX(pg_constraint_contypid_index,2666, on pg_constraint using btree(contypid oid_ops));
114 #define ConstraintTypidIndexId 2666
115 DECLARE_UNIQUE_INDEX(pg_constraint_oid_index,2667, on pg_constraint using btree(oid oid_ops));
116 #define ConstraintOidIndexId 2667
118 DECLARE_UNIQUE_INDEX(pg_conversion_default_index,2668, on pg_conversion using btree(connamespace oid_ops, conforencoding int4_ops, contoencoding int4_ops, oid oid_ops));
119 #define ConversionDefaultIndexId 2668
120 DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index,2669, on pg_conversion using btree(conname name_ops, connamespace oid_ops));
121 #define ConversionNameNspIndexId 2669
122 DECLARE_UNIQUE_INDEX(pg_conversion_oid_index,2670, on pg_conversion using btree(oid oid_ops));
123 #define ConversionOidIndexId 2670
125 DECLARE_UNIQUE_INDEX(pg_database_datname_index,2671, on pg_database using btree(datname name_ops));
126 #define DatabaseNameIndexId 2671
127 DECLARE_UNIQUE_INDEX(pg_database_oid_index,2672, on pg_database using btree(oid oid_ops));
128 #define DatabaseOidIndexId 2672
130 /* This following index is not used for a cache and is not unique */
131 DECLARE_INDEX(pg_depend_depender_index,2673, on pg_depend using btree(classid oid_ops, objid oid_ops, objsubid int4_ops));
132 #define DependDependerIndexId 2673
133 /* This following index is not used for a cache and is not unique */
134 DECLARE_INDEX(pg_depend_reference_index,2674, on pg_depend using btree(refclassid oid_ops, refobjid oid_ops, refobjsubid int4_ops));
135 #define DependReferenceIndexId 2674
137 DECLARE_UNIQUE_INDEX(pg_description_o_c_o_index,2675, on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
138 #define DescriptionObjIndexId 2675
140 /* This following index is not used for a cache and is not unique */
141 DECLARE_INDEX(pg_index_indrelid_index,2678, on pg_index using btree(indrelid oid_ops));
142 #define IndexIndrelidIndexId 2678
143 DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index,2679, on pg_index using btree(indexrelid oid_ops));
144 #define IndexRelidIndexId 2679
146 DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index,2680, on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops));
147 #define InheritsRelidSeqnoIndexId 2680
149 DECLARE_UNIQUE_INDEX(pg_language_name_index,2681, on pg_language using btree(lanname name_ops));
150 #define LanguageNameIndexId 2681
151 DECLARE_UNIQUE_INDEX(pg_language_oid_index,2682, on pg_language using btree(oid oid_ops));
152 #define LanguageOidIndexId 2682
154 DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index,2683, on pg_largeobject using btree(loid oid_ops, pageno int4_ops));
155 #define LargeObjectLOidPNIndexId 2683
157 DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index,2684, on pg_namespace using btree(nspname name_ops));
158 #define NamespaceNameIndexId 2684
159 DECLARE_UNIQUE_INDEX(pg_namespace_oid_index,2685, on pg_namespace using btree(oid oid_ops));
160 #define NamespaceOidIndexId 2685
162 DECLARE_UNIQUE_INDEX(pg_opclass_am_name_nsp_index,2686, on pg_opclass using btree(opcamid oid_ops, opcname name_ops, opcnamespace oid_ops));
163 #define OpclassAmNameNspIndexId 2686
164 DECLARE_UNIQUE_INDEX(pg_opclass_oid_index,2687, on pg_opclass using btree(oid oid_ops));
165 #define OpclassOidIndexId 2687
167 DECLARE_UNIQUE_INDEX(pg_operator_oid_index,2688, on pg_operator using btree(oid oid_ops));
168 #define OperatorOidIndexId 2688
169 DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_n_index,2689, on pg_operator using btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprnamespace oid_ops));
170 #define OperatorNameNspIndexId 2689
172 DECLARE_UNIQUE_INDEX(pg_proc_oid_index,2690, on pg_proc using btree(oid oid_ops));
173 #define ProcedureOidIndexId 2690
174 DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index,2691, on pg_proc using btree(proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops));
175 #define ProcedureNameArgsNspIndexId 2691
177 DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index,2692, on pg_rewrite using btree(oid oid_ops));
178 #define RewriteOidIndexId 2692
179 DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index,2693, on pg_rewrite using btree(ev_class oid_ops, rulename name_ops));
180 #define RewriteRelRulenameIndexId 2693
182 DECLARE_UNIQUE_INDEX(pg_statistic_relid_att_index,2696, on pg_statistic using btree(starelid oid_ops, staattnum int2_ops));
183 #define StatisticRelidAttnumIndexId 2696
185 DECLARE_UNIQUE_INDEX(pg_tablespace_oid_index,2697, on pg_tablespace using btree(oid oid_ops));
186 #define TablespaceOidIndexId 2697
187 DECLARE_UNIQUE_INDEX(pg_tablespace_spcname_index,2698, on pg_tablespace using btree(spcname name_ops));
188 #define TablespaceNameIndexId 2698
190 /* This following index is not used for a cache and is not unique */
191 DECLARE_INDEX(pg_trigger_tgconstrname_index,2699, on pg_trigger using btree(tgconstrname name_ops));
192 #define TriggerConstrNameIndexId 2699
193 /* This following index is not used for a cache and is not unique */
194 DECLARE_INDEX(pg_trigger_tgconstrrelid_index,2700, on pg_trigger using btree(tgconstrrelid oid_ops));
195 #define TriggerConstrRelidIndexId 2700
196 DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index,2701, on pg_trigger using btree(tgrelid oid_ops, tgname name_ops));
197 #define TriggerRelidNameIndexId 2701
198 DECLARE_UNIQUE_INDEX(pg_trigger_oid_index,2702, on pg_trigger using btree(oid oid_ops));
199 #define TriggerOidIndexId 2702
201 DECLARE_UNIQUE_INDEX(pg_type_oid_index,2703, on pg_type using btree(oid oid_ops));
202 #define TypeOidIndexId 2703
203 DECLARE_UNIQUE_INDEX(pg_type_typname_nsp_index,2704, on pg_type using btree(typname name_ops, typnamespace oid_ops));
204 #define TypeNameNspIndexId 2704
207 /* last step of initialization script: build the indexes declared above */
210 #endif /* INDEXING_H */