{
    "mode": "man",
    "parameter": "DROP_FOREIGN_TABLE",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/DROP_FOREIGN_TABLE/7/json",
    "generated": "2026-06-16T10:00:38Z",
    "synopsis": "DROP FOREIGN TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]",
    "sections": {
        "NAME": {
            "content": "DROPFOREIGNTABLE - remove a foreign table\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "DROP FOREIGN TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "DROP FOREIGN TABLE removes a foreign table. Only the owner of a foreign table can remove it.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "IF EXISTS\nDo not throw an error if the foreign table does not exist. A notice is issued in this\ncase.\n\nname\nThe name (optionally schema-qualified) of the foreign table to drop.\n\nCASCADE\nAutomatically drop objects that depend on the foreign table (such as views), and in turn\nall objects that depend on those objects (see Section 5.14).\n\nRESTRICT\nRefuse to drop the foreign table if any objects depend on it. This is the default.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To destroy two foreign tables, films and distributors:\n\nDROP FOREIGN TABLE films, distributors;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "This command conforms to ISO/IEC 9075-9 (SQL/MED), except that the standard only allows one\nforeign table to be dropped per command, and apart from the IF EXISTS option, which is a\nPostgreSQL extension.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ALTER FOREIGN TABLE (ALTERFOREIGNTABLE(7)), CREATE FOREIGN TABLE (CREATEFOREIGNTABLE(7))\n\n\n\nPostgreSQL 14.23                                2026                           DROP FOREIGN TABLE(7)",
            "subsections": []
        }
    },
    "summary": "DROPFOREIGNTABLE - remove a foreign table",
    "flags": [],
    "examples": [
        "To destroy two foreign tables, films and distributors:",
        "DROP FOREIGN TABLE films, distributors;"
    ],
    "see_also": [
        {
            "name": "ALTERFOREIGNTABLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERFOREIGNTABLE/7/json"
        },
        {
            "name": "CREATEFOREIGNTABLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATEFOREIGNTABLE/7/json"
        },
        {
            "name": "TABLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/TABLE/7/json"
        }
    ]
}