diff options
Diffstat (limited to 'src/backend/commands/remove.c')
-rw-r--r-- | src/backend/commands/remove.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/backend/commands/remove.c b/src/backend/commands/remove.c index 297b351df83..99b243ed4fd 100644 --- a/src/backend/commands/remove.c +++ b/src/backend/commands/remove.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.69 2002/03/19 02:18:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.70 2002/03/20 19:43:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -282,23 +282,18 @@ RemoveType(char *typeName) /* type name to be removed */ * use it. */ void -RemoveDomain(char *domainName, int behavior) /* domain name to be removed */ +RemoveDomain(char *domainName, int behavior) { Relation relation; HeapTuple tup; - TupleDesc description; char typtype; - bool isnull; - /* Domains are stored as types. Check for permissions on the type */ if (!pg_ownercheck(GetUserId(), domainName, TYPENAME)) elog(ERROR, "RemoveDomain: type '%s': permission denied", domainName); - relation = heap_openr(TypeRelationName, RowExclusiveLock); - description = RelationGetDescr(relation); tup = SearchSysCache(TYPENAME, PointerGetDatum(domainName), @@ -306,14 +301,11 @@ RemoveDomain(char *domainName, int behavior) /* domain name to be removed */ if (!HeapTupleIsValid(tup)) elog(ERROR, "RemoveType: type '%s' does not exist", domainName); - /* Check that this is actually a domain */ - typtype = DatumGetChar(heap_getattr(tup, Anum_pg_type_typtype, description, &isnull)); - Assert(!isnull); + typtype = ((Form_pg_type) GETSTRUCT(tup))->typtype; - if (typtype != 'd') { + if (typtype != 'd') elog(ERROR, "%s is not a domain", domainName); - } /* CASCADE unsupported */ if (behavior == CASCADE) { |