1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
/*-------------------------------------------------------------------------
*
* indexing.h
* This file provides some definitions to support indexing
* on system catalogs
*
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/indexing.h,v 1.86 2005/04/14 01:38:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef INDEXING_H
#define INDEXING_H
#include "access/htup.h"
/*
* Names of indexes on system catalogs
*
* References to specific system indexes in the C code should use these
* macros rather than hardwiring the actual index name.
*/
#define AccessMethodOperatorIndex "pg_amop_opr_opc_index"
#define AccessMethodStrategyIndex "pg_amop_opc_strat_index"
#define AccessMethodProcedureIndex "pg_amproc_opc_proc_index"
#define AggregateFnoidIndex "pg_aggregate_fnoid_index"
#define AmNameIndex "pg_am_name_index"
#define AmOidIndex "pg_am_oid_index"
#define AttrDefaultIndex "pg_attrdef_adrelid_adnum_index"
#define AttrDefaultOidIndex "pg_attrdef_oid_index"
#define AttributeRelidNameIndex "pg_attribute_relid_attnam_index"
#define AttributeRelidNumIndex "pg_attribute_relid_attnum_index"
#define CastOidIndex "pg_cast_oid_index"
#define CastSourceTargetIndex "pg_cast_source_target_index"
#define ClassNameNspIndex "pg_class_relname_nsp_index"
#define ClassOidIndex "pg_class_oid_index"
#define ConstraintNameNspIndex "pg_constraint_conname_nsp_index"
#define ConstraintOidIndex "pg_constraint_oid_index"
#define ConstraintRelidIndex "pg_constraint_conrelid_index"
#define ConstraintTypidIndex "pg_constraint_contypid_index"
#define ConversionDefaultIndex "pg_conversion_default_index"
#define ConversionNameNspIndex "pg_conversion_name_nsp_index"
#define ConversionOidIndex "pg_conversion_oid_index"
#define DatabaseNameIndex "pg_database_datname_index"
#define DatabaseOidIndex "pg_database_oid_index"
#define DependDependerIndex "pg_depend_depender_index"
#define DependReferenceIndex "pg_depend_reference_index"
#define DescriptionObjIndex "pg_description_o_c_o_index"
#define GroupNameIndex "pg_group_name_index"
#define GroupSysidIndex "pg_group_sysid_index"
#define IndexIndrelidIndex "pg_index_indrelid_index"
#define IndexRelidIndex "pg_index_indexrelid_index"
#define InheritsRelidSeqnoIndex "pg_inherits_relid_seqno_index"
#define LanguageNameIndex "pg_language_name_index"
#define LanguageOidIndex "pg_language_oid_index"
#define LargeObjectLOidPNIndex "pg_largeobject_loid_pn_index"
#define NamespaceNameIndex "pg_namespace_nspname_index"
#define NamespaceOidIndex "pg_namespace_oid_index"
#define OpclassAmNameNspIndex "pg_opclass_am_name_nsp_index"
#define OpclassOidIndex "pg_opclass_oid_index"
#define OperatorNameNspIndex "pg_operator_oprname_l_r_n_index"
#define OperatorOidIndex "pg_operator_oid_index"
#define ProcedureNameArgsNspIndex "pg_proc_proname_args_nsp_index"
#define ProcedureOidIndex "pg_proc_oid_index"
#define RewriteOidIndex "pg_rewrite_oid_index"
#define RewriteRelRulenameIndex "pg_rewrite_rel_rulename_index"
#define ShadowNameIndex "pg_shadow_usename_index"
#define ShadowSysidIndex "pg_shadow_usesysid_index"
#define StatisticRelidAttnumIndex "pg_statistic_relid_att_index"
#define TablespaceNameIndex "pg_tablespace_spcname_index"
#define TablespaceOidIndex "pg_tablespace_oid_index"
#define TriggerConstrNameIndex "pg_trigger_tgconstrname_index"
#define TriggerConstrRelidIndex "pg_trigger_tgconstrrelid_index"
#define TriggerRelidNameIndex "pg_trigger_tgrelid_tgname_index"
#define TriggerOidIndex "pg_trigger_oid_index"
#define TypeNameNspIndex "pg_type_typname_nsp_index"
#define TypeOidIndex "pg_type_oid_index"
/*
* The state object used by CatalogOpenIndexes and friends is actually the
* same as the executor's ResultRelInfo, but we give it another type name
* to decouple callers from that fact.
*/
typedef struct ResultRelInfo *CatalogIndexState;
/*
* indexing.c prototypes
*/
extern CatalogIndexState CatalogOpenIndexes(Relation heapRel);
extern void CatalogCloseIndexes(CatalogIndexState indstate);
extern void CatalogIndexInsert(CatalogIndexState indstate,
HeapTuple heapTuple);
extern void CatalogUpdateIndexes(Relation heapRel, HeapTuple heapTuple);
/*
* These macros are just to keep the C compiler from spitting up on the
* upcoming commands for genbki.sh.
*/
#define DECLARE_INDEX(name,oid,decl) extern int no_such_variable
#define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable
#define BUILD_INDICES
/*
* What follows are lines processed by genbki.sh to create the statements
* the bootstrap parser will turn into DefineIndex commands.
*
* The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX. The first two
* arguments are the index name and OID, the rest is much like a standard
* 'create index' SQL command.
*/
DECLARE_UNIQUE_INDEX(pg_aggregate_fnoid_index,2650, on pg_aggregate using btree(aggfnoid oid_ops));
#define AggregateFnoidIndexId 2650
DECLARE_UNIQUE_INDEX(pg_am_name_index,2651, on pg_am using btree(amname name_ops));
#define AmNameIndexId 2651
DECLARE_UNIQUE_INDEX(pg_am_oid_index,2652, on pg_am using btree(oid oid_ops));
#define AmOidIndexId 2652
DECLARE_UNIQUE_INDEX(pg_amop_opc_strat_index,2653, on pg_amop using btree(amopclaid oid_ops, amopsubtype oid_ops, amopstrategy int2_ops));
#define AccessMethodStrategyIndexId 2653
DECLARE_UNIQUE_INDEX(pg_amop_opr_opc_index,2654, on pg_amop using btree(amopopr oid_ops, amopclaid oid_ops));
#define AccessMethodOperatorIndexId 2654
DECLARE_UNIQUE_INDEX(pg_amproc_opc_proc_index,2655, on pg_amproc using btree(amopclaid oid_ops, amprocsubtype oid_ops, amprocnum int2_ops));
#define AccessMethodProcedureIndexId 2655
DECLARE_UNIQUE_INDEX(pg_attrdef_adrelid_adnum_index,2656, on pg_attrdef using btree(adrelid oid_ops, adnum int2_ops));
#define AttrDefaultIndexId 2656
DECLARE_UNIQUE_INDEX(pg_attrdef_oid_index,2657, on pg_attrdef using btree(oid oid_ops));
#define AttrDefaultOidIndexId 2657
DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index,2658, on pg_attribute using btree(attrelid oid_ops, attname name_ops));
#define AttributeRelidNameIndexId 2658
DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnum_index,2659, on pg_attribute using btree(attrelid oid_ops, attnum int2_ops));
#define AttributeRelidNumIndexId 2659
DECLARE_UNIQUE_INDEX(pg_cast_oid_index,2660, on pg_cast using btree(oid oid_ops));
#define CastOidIndexId 2660
DECLARE_UNIQUE_INDEX(pg_cast_source_target_index,2661, on pg_cast using btree(castsource oid_ops, casttarget oid_ops));
#define CastSourceTargetIndexId 2661
DECLARE_UNIQUE_INDEX(pg_class_oid_index,2662, on pg_class using btree(oid oid_ops));
#define ClassOidIndexId 2662
DECLARE_UNIQUE_INDEX(pg_class_relname_nsp_index,2663, on pg_class using btree(relname name_ops, relnamespace oid_ops));
#define ClassNameNspIndexId 2663
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_constraint_conname_nsp_index,2664, on pg_constraint using btree(conname name_ops, connamespace oid_ops));
#define ConstraintNameNspIndexId 2664
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_constraint_conrelid_index,2665, on pg_constraint using btree(conrelid oid_ops));
#define ConstraintRelidIndexId 2665
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_constraint_contypid_index,2666, on pg_constraint using btree(contypid oid_ops));
#define ConstraintTypidIndexId 2666
DECLARE_UNIQUE_INDEX(pg_constraint_oid_index,2667, on pg_constraint using btree(oid oid_ops));
#define ConstraintOidIndexId 2667
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));
#define ConversionDefaultIndexId 2668
DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index,2669, on pg_conversion using btree(conname name_ops, connamespace oid_ops));
#define ConversionNameNspIndexId 2669
DECLARE_UNIQUE_INDEX(pg_conversion_oid_index,2670, on pg_conversion using btree(oid oid_ops));
#define ConversionOidIndexId 2670
DECLARE_UNIQUE_INDEX(pg_database_datname_index,2671, on pg_database using btree(datname name_ops));
#define DatabaseNameIndexId 2671
DECLARE_UNIQUE_INDEX(pg_database_oid_index,2672, on pg_database using btree(oid oid_ops));
#define DatabaseOidIndexId 2672
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_depend_depender_index,2673, on pg_depend using btree(classid oid_ops, objid oid_ops, objsubid int4_ops));
#define DependDependerIndexId 2673
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_depend_reference_index,2674, on pg_depend using btree(refclassid oid_ops, refobjid oid_ops, refobjsubid int4_ops));
#define DependReferenceIndexId 2674
DECLARE_UNIQUE_INDEX(pg_description_o_c_o_index,2675, on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
#define DescriptionObjIndexId 2675
DECLARE_UNIQUE_INDEX(pg_group_name_index,2676, on pg_group using btree(groname name_ops));
#define GroupNameIndexId 2676
DECLARE_UNIQUE_INDEX(pg_group_sysid_index,2677, on pg_group using btree(grosysid int4_ops));
#define GroupSysidIndexId 2677
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_index_indrelid_index,2678, on pg_index using btree(indrelid oid_ops));
#define IndexIndrelidIndexId 2678
DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index,2679, on pg_index using btree(indexrelid oid_ops));
#define IndexRelidIndexId 2679
DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index,2680, on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops));
#define InheritsRelidSeqnoIndexId 2680
DECLARE_UNIQUE_INDEX(pg_language_name_index,2681, on pg_language using btree(lanname name_ops));
#define LanguageNameIndexId 2681
DECLARE_UNIQUE_INDEX(pg_language_oid_index,2682, on pg_language using btree(oid oid_ops));
#define LanguageOidIndexId 2682
DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index,2683, on pg_largeobject using btree(loid oid_ops, pageno int4_ops));
#define LargeObjectLOidPNIndexId 2683
DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index,2684, on pg_namespace using btree(nspname name_ops));
#define NamespaceNameIndexId 2684
DECLARE_UNIQUE_INDEX(pg_namespace_oid_index,2685, on pg_namespace using btree(oid oid_ops));
#define NamespaceOidIndexId 2685
DECLARE_UNIQUE_INDEX(pg_opclass_am_name_nsp_index,2686, on pg_opclass using btree(opcamid oid_ops, opcname name_ops, opcnamespace oid_ops));
#define OpclassAmNameNspIndexId 2686
DECLARE_UNIQUE_INDEX(pg_opclass_oid_index,2687, on pg_opclass using btree(oid oid_ops));
#define OpclassOidIndexId 2687
DECLARE_UNIQUE_INDEX(pg_operator_oid_index,2688, on pg_operator using btree(oid oid_ops));
#define OperatorOidIndexId 2688
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));
#define OperatorNameNspIndexId 2689
DECLARE_UNIQUE_INDEX(pg_proc_oid_index,2690, on pg_proc using btree(oid oid_ops));
#define ProcedureOidIndexId 2690
DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index,2691, on pg_proc using btree(proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops));
#define ProcedureNameArgsNspIndexId 2691
DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index,2692, on pg_rewrite using btree(oid oid_ops));
#define RewriteOidIndexId 2692
DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index,2693, on pg_rewrite using btree(ev_class oid_ops, rulename name_ops));
#define RewriteRelRulenameIndexId 2693
DECLARE_UNIQUE_INDEX(pg_shadow_usename_index,2694, on pg_shadow using btree(usename name_ops));
#define ShadowNameIndexId 2694
DECLARE_UNIQUE_INDEX(pg_shadow_usesysid_index,2695, on pg_shadow using btree(usesysid int4_ops));
#define ShadowSysidIndexId 2695
DECLARE_UNIQUE_INDEX(pg_statistic_relid_att_index,2696, on pg_statistic using btree(starelid oid_ops, staattnum int2_ops));
#define StatisticRelidAttnumIndexId 2696
DECLARE_UNIQUE_INDEX(pg_tablespace_oid_index,2697, on pg_tablespace using btree(oid oid_ops));
#define TablespaceOidIndexId 2697
DECLARE_UNIQUE_INDEX(pg_tablespace_spcname_index,2698, on pg_tablespace using btree(spcname name_ops));
#define TablespaceNameIndexId 2698
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_trigger_tgconstrname_index,2699, on pg_trigger using btree(tgconstrname name_ops));
#define TriggerConstrNameIndexId 2699
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_trigger_tgconstrrelid_index,2700, on pg_trigger using btree(tgconstrrelid oid_ops));
#define TriggerConstrRelidIndexId 2700
DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index,2701, on pg_trigger using btree(tgrelid oid_ops, tgname name_ops));
#define TriggerRelidNameIndexId 2701
DECLARE_UNIQUE_INDEX(pg_trigger_oid_index,2702, on pg_trigger using btree(oid oid_ops));
#define TriggerOidIndexId 2702
DECLARE_UNIQUE_INDEX(pg_type_oid_index,2703, on pg_type using btree(oid oid_ops));
#define TypeOidIndexId 2703
DECLARE_UNIQUE_INDEX(pg_type_typname_nsp_index,2704, on pg_type using btree(typname name_ops, typnamespace oid_ops));
#define TypeNameNspIndexId 2704
/* last step of initialization script: build the indexes declared above */
BUILD_INDICES
#endif /* INDEXING_H */
|