Updated on 2025-05-29 GMT+08:00

DROP FOREIGN TABLE

Description

Drops a foreign table.

Precautions

DROP FOREIGN TABLE forcibly deletes a specified table. After a table is deleted, all indexes that depend on the table are deleted, and the functions and stored procedures using this table cannot be executed.

Syntax

1
DROP FOREIGN TABLE [ IF EXISTS ] table_name [, ...] [ CASCADE | RESTRICT ];

Parameters

  • IF EXISTS

    Reports a notice instead of an error if the specified table does not exist.

  • table_name

    Specifies the name of the table to be deleted.

    Value range: an existing table name

  • CASCADE | RESTRICT
    • CASCADE: automatically deletes the objects (such as views) that depend on the table.
    • RESTRICT: refuses to drop the table if any objects depend on it. This is the default action.

Examples

For details, see Examples.

Helpful Links

CREATE FOREIGN TABLE