|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.41 1999/07/2016:48:54 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.42 1999/07/2017:14:06 momjian Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
|
28 | 28 |
|
29 | 29 | /* |
30 | 30 | * Names of indices on the following system catalogs: |
| 31 | + * |
| 32 | + *pg_attribute |
| 33 | + *pg_proc |
| 34 | + *pg_type |
| 35 | + *pg_naming |
| 36 | + *pg_class |
| 37 | + *pg_attrdef |
| 38 | + *pg_relcheck |
| 39 | + *pg_trigger |
31 | 40 | */ |
32 | 41 |
|
33 | | -char*Name_pg_amop_indices[Num_pg_amop_indices]= {AccessMethodOpidIndex, |
34 | | -AccessMethodStrategyIndex}; |
35 | 42 | char*Name_pg_attr_indices[Num_pg_attr_indices]= {AttributeNameIndex, |
36 | | -AttributeNumIndex,AttributeRelidIndex}; |
37 | | -char*Name_pg_index_indices[Num_pg_index_indices]= {IndexRelidIndex}; |
| 43 | +AttributeNumIndex, |
| 44 | +AttributeRelidIndex}; |
38 | 45 | char*Name_pg_proc_indices[Num_pg_proc_indices]= {ProcedureNameIndex, |
39 | | -ProcedureOidIndex,ProcedureSrcIndex}; |
| 46 | +ProcedureOidIndex, |
| 47 | +ProcedureSrcIndex}; |
40 | 48 | char*Name_pg_type_indices[Num_pg_type_indices]= {TypeNameIndex, |
41 | | -TypeOidIndex}; |
| 49 | +TypeOidIndex}; |
42 | 50 | char*Name_pg_class_indices[Num_pg_class_indices]= {ClassNameIndex, |
43 | | -ClassOidIndex}; |
| 51 | +ClassOidIndex}; |
44 | 52 | char*Name_pg_attrdef_indices[Num_pg_attrdef_indices]= {AttrDefaultIndex}; |
45 | 53 |
|
46 | 54 | char*Name_pg_relcheck_indices[Num_pg_relcheck_indices]= {RelCheckIndex}; |
47 | 55 |
|
48 | 56 | char*Name_pg_trigger_indices[Num_pg_trigger_indices]= {TriggerRelidIndex}; |
49 | | -char*Name_pg_description_indices[Num_pg_description_indices]= {DescriptionObjIndex}; |
50 | 57 |
|
51 | 58 |
|
52 | 59 | staticHeapTupleCatalogIndexFetchTuple(RelationheapRelation, |
53 | | -Relationidesc,ScanKeyskey,int16num_keys); |
| 60 | +Relationidesc, |
| 61 | +ScanKeyskey, |
| 62 | +int16num_keys); |
54 | 63 |
|
55 | 64 |
|
56 | 65 | /* |
@@ -243,89 +252,12 @@ CatalogIndexFetchTuple(Relation heapRelation, |
243 | 252 | } |
244 | 253 |
|
245 | 254 |
|
246 | | -/*--------------------------------------------------------------------- |
247 | | - * Class-specific index lookups |
248 | | - *--------------------------------------------------------------------- |
249 | | - */ |
250 | | - |
251 | 255 | /* |
252 | 256 | * The remainder of the file is for individual index scan routines. Each |
253 | 257 | * index should be scanned according to how it was defined during bootstrap |
254 | 258 | * (that is, functional or normal) and what arguments the cache lookup |
255 | 259 | * requires. Each routine returns the heap tuple that qualifies. |
256 | 260 | */ |
257 | | -HeapTuple |
258 | | -AccessMethodOpidIndexScan(RelationheapRelation, |
259 | | -Oidclaid, |
260 | | -Oidopopr, |
261 | | -Oidopid) |
262 | | -{ |
263 | | -Relationidesc; |
264 | | -ScanKeyDataskey[3]; |
265 | | -HeapTupletuple; |
266 | | - |
267 | | -ScanKeyEntryInitialize(&skey[0], |
268 | | - (bits16)0x0, |
269 | | - (AttrNumber)1, |
270 | | - (RegProcedure)F_OIDEQ, |
271 | | -ObjectIdGetDatum(claid)); |
272 | | - |
273 | | -ScanKeyEntryInitialize(&skey[1], |
274 | | - (bits16)0x0, |
275 | | - (AttrNumber)2, |
276 | | - (RegProcedure)F_OIDEQ, |
277 | | -ObjectIdGetDatum(opopr)); |
278 | | - |
279 | | -ScanKeyEntryInitialize(&skey[2], |
280 | | - (bits16)0x0, |
281 | | - (AttrNumber)3, |
282 | | - (RegProcedure)F_OIDEQ, |
283 | | -ObjectIdGetDatum(opid)); |
284 | | - |
285 | | -idesc=index_openr(AccessMethodOpidIndex); |
286 | | -tuple=CatalogIndexFetchTuple(heapRelation,idesc,skey,3); |
287 | | - |
288 | | -index_close(idesc); |
289 | | - |
290 | | -returntuple; |
291 | | -} |
292 | | - |
293 | | -HeapTuple |
294 | | -AccessMethodStrategyIndexScan(RelationheapRelation, |
295 | | -Oidopid, |
296 | | -Oidclaid, |
297 | | -int2opstrategy) |
298 | | -{ |
299 | | -Relationidesc; |
300 | | -ScanKeyDataskey[3]; |
301 | | -HeapTupletuple; |
302 | | - |
303 | | -ScanKeyEntryInitialize(&skey[0], |
304 | | - (bits16)0x0, |
305 | | - (AttrNumber)1, |
306 | | - (RegProcedure)F_OIDEQ, |
307 | | -ObjectIdGetDatum(opid)); |
308 | | - |
309 | | -ScanKeyEntryInitialize(&skey[1], |
310 | | - (bits16)0x0, |
311 | | - (AttrNumber)2, |
312 | | - (RegProcedure)F_OIDEQ, |
313 | | -ObjectIdGetDatum(claid)); |
314 | | - |
315 | | -ScanKeyEntryInitialize(&skey[2], |
316 | | - (bits16)0x0, |
317 | | - (AttrNumber)3, |
318 | | - (RegProcedure)F_INT2EQ, |
319 | | -Int16GetDatum(opstrategy)); |
320 | | - |
321 | | -idesc=index_openr(AccessMethodStrategyIndex); |
322 | | -tuple=CatalogIndexFetchTuple(heapRelation,idesc,skey,3); |
323 | | - |
324 | | -index_close(idesc); |
325 | | - |
326 | | -returntuple; |
327 | | -} |
328 | | - |
329 | 261 | HeapTuple |
330 | 262 | AttributeNameIndexScan(RelationheapRelation, |
331 | 263 | Oidrelid, |
@@ -385,28 +317,6 @@ AttributeNumIndexScan(Relation heapRelation, |
385 | 317 | returntuple; |
386 | 318 | } |
387 | 319 |
|
388 | | -HeapTuple |
389 | | -IndexRelidIndexScan(RelationheapRelation,Oidrelid) |
390 | | -{ |
391 | | -Relationidesc; |
392 | | -ScanKeyDataskey[1]; |
393 | | -HeapTupletuple; |
394 | | - |
395 | | -ScanKeyEntryInitialize(&skey[0], |
396 | | - (bits16)0x0, |
397 | | - (AttrNumber)1, |
398 | | - (RegProcedure)F_OIDEQ, |
399 | | -ObjectIdGetDatum(relid)); |
400 | | - |
401 | | -idesc=index_openr(IndexRelidIndex); |
402 | | -tuple=CatalogIndexFetchTuple(heapRelation,idesc,skey,1); |
403 | | - |
404 | | -index_close(idesc); |
405 | | - |
406 | | -returntuple; |
407 | | -} |
408 | | - |
409 | | - |
410 | 320 |
|
411 | 321 | HeapTuple |
412 | 322 | ProcedureOidIndexScan(RelationheapRelation,OidprocId) |
|