{
    "mode": "man",
    "parameter": "DROP_OPERATOR_CLASS",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/DROP_OPERATOR_CLASS/7/json",
    "generated": "2026-06-15T18:52:03Z",
    "synopsis": "DROP OPERATOR CLASS [ IF EXISTS ] name USING indexmethod [ CASCADE | RESTRICT ]",
    "sections": {
        "NAME": {
            "content": "DROPOPERATORCLASS - remove an operator class\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "DROP OPERATOR CLASS [ IF EXISTS ] name USING indexmethod [ CASCADE | RESTRICT ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "DROP OPERATOR CLASS drops an existing operator class. To execute this command you must be the\nowner of the operator class.\n\nDROP OPERATOR CLASS does not drop any of the operators or functions referenced by the class.\nIf there are any indexes depending on the operator class, you will need to specify CASCADE\nfor the drop to complete.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "IF EXISTS\nDo not throw an error if the operator class does not exist. A notice is issued in this\ncase.\n\nname\nThe name (optionally schema-qualified) of an existing operator class.\n\nindexmethod\nThe name of the index access method the operator class is for.\n\nCASCADE\nAutomatically drop objects that depend on the operator class (such as indexes), and in\nturn all objects that depend on those objects (see Section 5.14).\n\nRESTRICT\nRefuse to drop the operator class if any objects depend on it. This is the default.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "DROP OPERATOR CLASS will not drop the operator family containing the class, even if there is\nnothing else left in the family (in particular, in the case where the family was implicitly\ncreated by CREATE OPERATOR CLASS). An empty operator family is harmless, but for the sake of\ntidiness you might wish to remove the family with DROP OPERATOR FAMILY; or perhaps better,\nuse DROP OPERATOR FAMILY in the first place.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Remove the B-tree operator class widgetops:\n\nDROP OPERATOR CLASS widgetops USING btree;\n\nThis command will not succeed if there are any existing indexes that use the operator class.\nAdd CASCADE to drop such indexes along with the operator class.\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "There is no DROP OPERATOR CLASS statement in the SQL standard.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ALTER OPERATOR CLASS (ALTEROPERATORCLASS(7)), CREATE OPERATOR CLASS\n(CREATEOPERATORCLASS(7)), DROP OPERATOR FAMILY (DROPOPERATORFAMILY(7))\n\n\n\nPostgreSQL 14.23                                2026                          DROP OPERATOR CLASS(7)",
            "subsections": []
        }
    },
    "summary": "DROPOPERATORCLASS - remove an operator class",
    "flags": [],
    "examples": [
        "Remove the B-tree operator class widgetops:",
        "DROP OPERATOR CLASS widgetops USING btree;",
        "This command will not succeed if there are any existing indexes that use the operator class.",
        "Add CASCADE to drop such indexes along with the operator class."
    ],
    "see_also": [
        {
            "name": "ALTEROPERATORCLASS",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTEROPERATORCLASS/7/json"
        },
        {
            "name": "CREATEOPERATORCLASS",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATEOPERATORCLASS/7/json"
        },
        {
            "name": "DROPOPERATORFAMILY",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPOPERATORFAMILY/7/json"
        },
        {
            "name": "CLASS",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CLASS/7/json"
        }
    ]
}