---
title: "DROP OPERATOR CLASS"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/ddl_drop_operator_class/"
---

# DROP OPERATOR CLASS

Use the DROP OPERATOR CLASS statement to remove an operator class.

## Synopsis

Use the DROP OPERATOR CLASS statement to remove an operator class.

## Syntax

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
drop_operator_class ::= DROP OPERATOR CLASS [ IF EXISTS ] 
                        operator_class_name USING index_method 
                        [ CASCADE | RESTRICT ]
```

#### drop\_operator\_class

DROPOPERATORCLASSIFEXISTS[operator\_class\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#operator-class-name)USING[index\_method](/stable/api/ysql/syntax_resources/grammar_diagrams#index-method)CASCADERESTRICT

## Semantics

See the semantics of each option in the [PostgreSQL docs](https://www.postgresql.org/docs/15/sql-dropopclass.html "PostgreSQL docs").

## Examples

Basic example.

```plpgsql
yugabyte=# CREATE OPERATOR CLASS my_op_class
           FOR TYPE int4
           USING btree AS
           OPERATOR 1 <,
           OPERATOR 2 <=;
yugabyte=# DROP OPERATOR CLASS my_op_class USING btree;
```

## See also

- [CREATE OPERATOR CLASS](/stable/api/ysql/the-sql-language/statements/ddl_create_operator_class "CREATE OPERATOR CLASS")
