*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.28 1998/09/01 06:51:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.29 1998/09/01 16:21:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Relation heapRelation,
HeapTuple heapTuple)
{
- HeapTuple pgIndexTup;
+ HeapTuple index_tup;
TupleDesc heapDescriptor;
- Form_pg_index pgIndexP;
+ Form_pg_index index_form;
Datum datum;
int natts;
AttrNumber *attnumP;
{
InsertIndexResult indexRes;
- pgIndexTup = SearchSysCacheTupleCopy(INDEXRELID,
+ index_tup = SearchSysCacheTupleCopy(INDEXRELID,
ObjectIdGetDatum(idescs[i]->rd_id),
0, 0, 0);
- Assert(pgIndexTup);
- pgIndexP = (Form_pg_index) GETSTRUCT(pgIndexTup);
+ Assert(index_tup);
+ index_form = (Form_pg_index) GETSTRUCT(index_tup);
/*
* Compute the number of attributes we are indexing upon.
*/
- for (attnumP = pgIndexP->indkey, natts = 0;
+ for (attnumP = index_form->indkey, natts = 0;
*attnumP != InvalidAttrNumber;
attnumP++, natts++)
;
- if (pgIndexP->indproc != InvalidOid)
+ if (index_form->indproc != InvalidOid)
{
FIgetnArgs(&finfo) = natts;
natts = 1;
- FIgetProcOid(&finfo) = pgIndexP->indproc;
+ FIgetProcOid(&finfo) = index_form->indproc;
*(FIgetname(&finfo)) = '\0';
finfoP = &finfo;
}
finfoP = (FuncIndexInfo *) NULL;
FormIndexDatum(natts,
- (AttrNumber *) pgIndexP->indkey,
+ (AttrNumber *) index_form->indkey,
heapTuple,
heapDescriptor,
&datum,
&heapTuple->t_ctid, heapRelation);
if (indexRes)
pfree(indexRes);
- pfree(pgIndexTup);
+ pfree(index_tup);
}
}
sd = index_beginscan(idesc, false, num_keys, skey);
while ((indexRes = index_getnext(sd, ForwardScanDirection)))
{
- ItemPointer iptr;
-
- iptr = &indexRes->heap_iptr;
- tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
+ tuple = heap_fetch(heapRelation, SnapshotNow, &indexRes->heap_iptr,
+ &buffer);
pfree(indexRes);
if (HeapTupleIsValid(tuple))
break;