1DROP OPERATOR CLASS(7)   PostgreSQL 13.3 Documentation  DROP OPERATOR CLASS(7)
2
3
4

NAME

6       DROP_OPERATOR_CLASS - remove an operator class
7

SYNOPSIS

9       DROP OPERATOR CLASS [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]
10

DESCRIPTION

12       DROP OPERATOR CLASS drops an existing operator class. To execute this
13       command you must be the owner of the operator class.
14
15       DROP OPERATOR CLASS does not drop any of the operators or functions
16       referenced by the class. If there are any indexes depending on the
17       operator class, you will need to specify CASCADE for the drop to
18       complete.
19

PARAMETERS

21       IF EXISTS
22           Do not throw an error if the operator class does not exist. A
23           notice is issued in this case.
24
25       name
26           The name (optionally schema-qualified) of an existing operator
27           class.
28
29       index_method
30           The name of the index access method the operator class is for.
31
32       CASCADE
33           Automatically drop objects that depend on the operator class (such
34           as indexes), and in turn all objects that depend on those objects
35           (see Section 5.14).
36
37       RESTRICT
38           Refuse to drop the operator class if any objects depend on it. This
39           is the default.
40

NOTES

42       DROP OPERATOR CLASS will not drop the operator family containing the
43       class, even if there is nothing else left in the family (in particular,
44       in the case where the family was implicitly created by CREATE OPERATOR
45       CLASS). An empty operator family is harmless, but for the sake of
46       tidiness you might wish to remove the family with DROP OPERATOR FAMILY;
47       or perhaps better, use DROP OPERATOR FAMILY in the first place.
48

EXAMPLES

50       Remove the B-tree operator class widget_ops:
51
52           DROP OPERATOR CLASS widget_ops USING btree;
53
54       This command will not succeed if there are any existing indexes that
55       use the operator class. Add CASCADE to drop such indexes along with the
56       operator class.
57

COMPATIBILITY

59       There is no DROP OPERATOR CLASS statement in the SQL standard.
60

SEE ALSO

62       ALTER OPERATOR CLASS (ALTER_OPERATOR_CLASS(7)), CREATE OPERATOR CLASS
63       (CREATE_OPERATOR_CLASS(7)), DROP OPERATOR FAMILY
64       (DROP_OPERATOR_FAMILY(7))
65
66
67
68PostgreSQL 13.3                      2021               DROP OPERATOR CLASS(7)
Impressum