Drop an operator class

The DROP OPCLASS statement removes the definition for an operator class from the database. The database server removes the operator-class definition from the sysopclasses system catalog table. You must be the owner of the operator class or the DBA to drop its definition from the database.

You must remove all dependent objects before you can drop the operator class. For example, suppose you have created a new operator class called abs_btree_ops for the generic B-tree index. (For more information, see Creating a new B-tree operator class.) To drop the abs_btree_ops operator class from the database, you must first ensure that:
  • You are the owner (the person who created the operator class) or the DBA.
  • No indexes are currently defined that use the abs_btree_ops operator class.

    If such indexes exist, you must first remove them from the database.

After you meet the preceding conditions, the following statement removes the definition of abs_btree_ops from the database:
DROP OPCLASS abs_btree_ops RESTRICT

The RESTRICT keyword is required in the DROP OPCLASS syntax.