DROP FOREIGN TABLE
Synopsis
Use the DROP FOREIGN TABLE
command to remove a foreign table. The user who executes the command must be the owner of the foreign table.
Syntax
drop_foreign_table ::= DROP FOREIGN TABLE [ IF EXISTS ] table_name
[ CASCADE | RESTRICT ]
drop_foreign_table
Semantics
Drop a foreign table named table_name. If it doesn’t exist in the database, an error will be thrown unless the IF EXISTS
clause is used.
RESTRICT/CASCADE:
RESTRICT
is the default and it will not drop the foreign table if any objects depend on it.
CASCADE
will drop the foreign table and any objects that transitively depend on it.
Examples
Drop the foreign-data table mytable
, along with any objects that depend on it.
yugabyte=# DROP FOREIGN TABLE mytable CASCADE;