{
    "mode": "man",
    "parameter": "DROP_RULE",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/DROP_RULE/7/json",
    "generated": "2026-06-15T13:51:57Z",
    "synopsis": "DROP RULE [ IF EXISTS ] name ON tablename [ CASCADE | RESTRICT ]",
    "sections": {
        "NAME": {
            "content": "DROPRULE - remove a rewrite rule\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "DROP RULE [ IF EXISTS ] name ON tablename [ CASCADE | RESTRICT ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "DROP RULE drops a rewrite rule.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "IF EXISTS\nDo not throw an error if the rule does not exist. A notice is issued in this case.\n\nname\nThe name of the rule to drop.\n\ntablename\nThe name (optionally schema-qualified) of the table or view that the rule applies to.\n\nCASCADE\nAutomatically drop objects that depend on the rule, and in turn all objects that depend\non those objects (see Section 5.14).\n\nRESTRICT\nRefuse to drop the rule if any objects depend on it. This is the default.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To drop the rewrite rule newrule:\n\nDROP RULE newrule ON mytable;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "DROP RULE is a PostgreSQL language extension, as is the entire query rewrite system.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE RULE (CREATERULE(7)), ALTER RULE (ALTERRULE(7))\n\n\n\nPostgreSQL 14.23                                2026                                    DROP RULE(7)",
            "subsections": []
        }
    },
    "summary": "DROPRULE - remove a rewrite rule",
    "flags": [],
    "examples": [
        "To drop the rewrite rule newrule:",
        "DROP RULE newrule ON mytable;"
    ],
    "see_also": [
        {
            "name": "CREATERULE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATERULE/7/json"
        },
        {
            "name": "ALTERRULE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERRULE/7/json"
        },
        {
            "name": "RULE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/RULE/7/json"
        }
    ]
}