aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/opclasscmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/opclasscmds.c')
-rw-r--r--src/backend/commands/opclasscmds.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index af0de05a032..0ef3584bb2f 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -1543,104 +1543,6 @@ dropProcedures(List *opfamilyname, Oid amoid, Oid opfamilyoid,
}
}
-
-/*
- * RemoveOpClass
- * Deletes an opclass.
- */
-void
-RemoveOpClass(RemoveOpClassStmt *stmt)
-{
- Oid amID,
- opcID;
- HeapTuple tuple;
- ObjectAddress object;
-
- /* Get the access method's OID. */
- amID = get_am_oid(stmt->amname, false);
-
- /* Look up the opclass. */
- tuple = OpClassCacheLookup(amID, stmt->opclassname, stmt->missing_ok);
- if (!HeapTupleIsValid(tuple))
- {
- ereport(NOTICE,
- (errmsg("operator class \"%s\" does not exist for access method \"%s\", skipping",
- NameListToString(stmt->opclassname), stmt->amname)));
- return;
- }
-
- opcID = HeapTupleGetOid(tuple);
-
- /* Permission check: must own opclass or its namespace */
- if (!pg_opclass_ownercheck(opcID, GetUserId()) &&
- !pg_namespace_ownercheck(((Form_pg_opclass) GETSTRUCT(tuple))->opcnamespace,
- GetUserId()))
- aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPCLASS,
- NameListToString(stmt->opclassname));
-
- ReleaseSysCache(tuple);
-
- /*
- * Do the deletion
- */
- object.classId = OperatorClassRelationId;
- object.objectId = opcID;
- object.objectSubId = 0;
-
- performDeletion(&object, stmt->behavior);
-}
-
-/*
- * RemoveOpFamily
- * Deletes an opfamily.
- */
-void
-RemoveOpFamily(RemoveOpFamilyStmt *stmt)
-{
- Oid amID,
- opfID;
- HeapTuple tuple;
- ObjectAddress object;
-
- /*
- * Get the access method's OID.
- */
- amID = get_am_oid(stmt->amname, false);
-
- /*
- * Look up the opfamily.
- */
- tuple = OpFamilyCacheLookup(amID, stmt->opfamilyname, stmt->missing_ok);
- if (!HeapTupleIsValid(tuple))
- {
- ereport(NOTICE,
- (errmsg("operator family \"%s\" does not exist for access method \"%s\", skipping",
- NameListToString(stmt->opfamilyname), stmt->amname)));
- return;
- }
-
- opfID = HeapTupleGetOid(tuple);
-
- /* Permission check: must own opfamily or its namespace */
- if (!pg_opfamily_ownercheck(opfID, GetUserId()) &&
- !pg_namespace_ownercheck(((Form_pg_opfamily) GETSTRUCT(tuple))->opfnamespace,
- GetUserId()))
- aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_OPFAMILY,
- NameListToString(stmt->opfamilyname));
-
- ReleaseSysCache(tuple);
-
- /*
- * Do the deletion
- */
- object.classId = OperatorFamilyRelationId;
- object.objectId = opfID;
- object.objectSubId = 0;
-
- performDeletion(&object, stmt->behavior);
-}
-
-
/*
* Deletion subroutines for use by dependency.c.
*/