---
title: "DROP FOREIGN TABLE"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/ddl_drop_foreign_table/"
---

# DROP FOREIGN TABLE

Use the DROP FOREIGN TABLE statement to drop a 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

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
drop_foreign_table ::= DROP FOREIGN TABLE [ IF EXISTS ] table_name 
                       [ CASCADE | RESTRICT ]
```

#### drop\_foreign\_table

DROPFOREIGNTABLEIFEXISTS[table\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#table-name)CASCADERESTRICT

## 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.

```plpgsql
yugabyte=# DROP FOREIGN TABLE mytable CASCADE;
```

## See also

- [CREATE FOREIGN TABLE](/stable/api/ysql/the-sql-language/statements/ddl_create_foreign_table/ "CREATE FOREIGN TABLE")
- [ALTER FOREIGN TABLE](/stable/api/ysql/the-sql-language/statements/ddl_alter_foreign_table/ "ALTER FOREIGN TABLE")
