{
    "mode": "man",
    "parameter": "DROP_TABLE",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/DROP_TABLE/7/json",
    "generated": "2026-10-04T13:36:11Z",
    "synopsis": "DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]",
    "sections": {
        "NAME": {
            "content": "DROPTABLE - remove a table\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "DROP TABLE removes tables from the database. Only the table owner, the schema owner, and\nsuperuser can drop a table. To empty a table of rows without destroying the table, use DELETE\nor TRUNCATE.\n\nDROP TABLE always removes any indexes, rules, triggers, and constraints that exist for the\ntarget table. However, to drop a table that is referenced by a view or a foreign-key\nconstraint of another table, CASCADE must be specified. (CASCADE will remove a dependent view\nentirely, but in the foreign-key case it will only remove the foreign-key constraint, not the\nother table entirely.)\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "IF EXISTS\nDo not throw an error if the table does not exist. A notice is issued in this case.\n\nname\nThe name (optionally schema-qualified) of the table to drop.\n\nCASCADE\nAutomatically drop objects that depend on the table (such as views), and in turn all\nobjects that depend on those objects (see Section 5.14).\n\nRESTRICT\nRefuse to drop the table if any objects depend on it. This is the default.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To destroy two tables, films and distributors:\n\nDROP TABLE films, distributors;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "This command conforms to the SQL standard, except that the standard only allows one table to\nbe dropped per command, and apart from the IF EXISTS option, which is a PostgreSQL extension.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ALTER TABLE (ALTERTABLE(7)), CREATE TABLE (CREATETABLE(7))\n\nPostgreSQL 16.14                                2026                                   DROP TABLE(7)",
            "subsections": []
        }
    },
    "summary": "DROPTABLE - remove a table",
    "flags": [],
    "examples": [
        "To destroy two tables, films and distributors:",
        "DROP TABLE films, distributors;"
    ],
    "see_also": [
        {
            "name": "ALTERTABLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERTABLE/7/json"
        },
        {
            "name": "CREATETABLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATETABLE/7/json"
        },
        {
            "name": "TABLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/TABLE/7/json"
        }
    ]
}