9
9
*
10
10
*
11
11
* IDENTIFICATION
12
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.59 2000/07/05 23:11:26 tgl Exp $
12
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.60 2000/07/27 23:16:04 tgl Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -272,15 +272,12 @@ join_selectivity(Oid functionObjectId,
272
272
List *
273
273
find_inheritance_children (Oid inhparent )
274
274
{
275
- static ScanKeyData key [1 ] = {
276
- {0 , Anum_pg_inherits_inhparent , F_OIDEQ }
277
- };
278
-
279
275
List * list = NIL ;
280
276
Relation relation ;
281
277
HeapScanDesc scan ;
282
278
HeapTuple inheritsTuple ;
283
279
Oid inhrelid ;
280
+ ScanKeyData key [1 ];
284
281
285
282
/*
286
283
* Can skip the scan if pg_class shows the relation has never had
@@ -289,10 +286,11 @@ find_inheritance_children(Oid inhparent)
289
286
if (! has_subclass (inhparent ))
290
287
return NIL ;
291
288
292
- fmgr_info (F_OIDEQ , & key [0 ].sk_func );
293
- key [0 ].sk_nargs = key [0 ].sk_func .fn_nargs ;
294
- key [0 ].sk_argument = ObjectIdGetDatum (inhparent );
295
-
289
+ ScanKeyEntryInitialize (& key [0 ],
290
+ (bits16 ) 0x0 ,
291
+ (AttrNumber ) Anum_pg_inherits_inhparent ,
292
+ (RegProcedure ) F_OIDEQ ,
293
+ ObjectIdGetDatum (inhparent ));
296
294
relation = heap_openr (InheritsRelationName , AccessShareLock );
297
295
scan = heap_beginscan (relation , 0 , SnapshotNow , 1 , key );
298
296
while (HeapTupleIsValid (inheritsTuple = heap_getnext (scan , 0 )))
@@ -330,45 +328,3 @@ has_subclass(Oid relationId)
330
328
relationId );
331
329
return ((Form_pg_class ) GETSTRUCT (tuple ))-> relhassubclass ;
332
330
}
333
-
334
- #ifdef NOT_USED
335
- /*
336
- * VersionGetParents
337
- *
338
- * Returns a LISP list containing the OIDs of all relations which are
339
- * base relations of the relation with OID 'verrelid'.
340
- */
341
- List *
342
- VersionGetParents (Oid verrelid )
343
- {
344
- static ScanKeyData key [1 ] = {
345
- {0 , Anum_pg_version_verrelid , F_OIDEQ }
346
- };
347
-
348
- HeapTuple versionTuple ;
349
- Relation relation ;
350
- HeapScanDesc scan ;
351
- Oid verbaseid ;
352
- List * list = NIL ;
353
-
354
- fmgr_info (F_OIDEQ , & key [0 ].sk_func );
355
- key [0 ].sk_nargs = key [0 ].sk_func .fn_nargs ;
356
- key [0 ].sk_argument = ObjectIdGetDatum (verrelid );
357
- relation = heap_openr (VersionRelationName , AccessShareLock );
358
- scan = heap_beginscan (relation , 0 , SnapshotNow , 1 , key );
359
- while (HeapTupleIsValid (versionTuple = heap_getnext (scan , 0 )))
360
- {
361
- verbaseid = ((Form_pg_version )
362
- GETSTRUCT (versionTuple ))-> verbaseid ;
363
-
364
- list = lconsi (verbaseid , list );
365
-
366
- key [0 ].sk_argument = ObjectIdGetDatum (verbaseid );
367
- heap_rescan (scan , 0 , key );
368
- }
369
- heap_endscan (scan );
370
- heap_close (relation , AccessShareLock );
371
- return list ;
372
- }
373
-
374
- #endif
0 commit comments