aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/functioncmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r--src/backend/commands/functioncmds.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index ea5ba103131..328643c171e 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.34 2003/09/10 19:59:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.35 2003/09/24 18:54:01 tgl Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
@@ -1095,24 +1095,25 @@ DropCast(DropCastStmt *stmt)
void
DropCastById(Oid castOid)
{
- Relation relation,
- index;
+ Relation relation;
ScanKeyData scankey;
- IndexScanDesc scan;
+ SysScanDesc scan;
HeapTuple tuple;
relation = heap_openr(CastRelationName, RowExclusiveLock);
- index = index_openr(CastOidIndex);
ScanKeyEntryInitialize(&scankey, 0x0,
- 1, F_OIDEQ, ObjectIdGetDatum(castOid));
- scan = index_beginscan(relation, index, SnapshotNow, 1, &scankey);
- tuple = index_getnext(scan, ForwardScanDirection);
+ ObjectIdAttributeNumber,
+ F_OIDEQ,
+ ObjectIdGetDatum(castOid));
+ scan = systable_beginscan(relation, CastOidIndex, true,
+ SnapshotNow, 1, &scankey);
+
+ tuple = systable_getnext(scan);
if (!HeapTupleIsValid(tuple))
elog(ERROR, "could not find tuple for cast %u", castOid);
simple_heap_delete(relation, &tuple->t_self);
- index_endscan(scan);
- index_close(index);
+ systable_endscan(scan);
heap_close(relation, RowExclusiveLock);
}