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

# DROP FOREIGN DATA WRAPPER

Use the DROP FOREIGN DATA WRAPPER statement to drop a foreign-data wrapper.

## Synopsis

Use the `DROP FOREIGN DATA WRAPPER` command to remove a foreign-data wrapper. The user who executes the command must be the owner of the foreign-data wrapper.

## Syntax

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

```output.ebnf
drop_foreign_data_wrapper ::= DROP FOREIGN DATA WRAPPER [ IF EXISTS ] 
                              fdw_name [ CASCADE | RESTRICT ]
```

#### drop\_foreign\_data\_wrapper

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

## Semantics

Drop a foreign-data wrapper named **fdw\_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-data wrapper if any objects depend on it. `CASCADE` will drop the foreign-data wrapper and any objects that transitively depend on it.

## Examples

Drop the foreign-data wrapper `my_wrapper`, along with any objects that depend on it.

```plpgsql
yugabyte=# DROP FOREIGN DATA WRAPPER my_wrapper CASCADE;
```

## See also

- [CREATE FOREIGN DATA WRAPPER](/stable/api/ysql/the-sql-language/statements/ddl_create_foreign_data_wrapper/ "CREATE FOREIGN DATA WRAPPER")
- [ALTER FOREIGN DATA WRAPPER](/stable/api/ysql/the-sql-language/statements/ddl_alter_foreign_data_wrapper/ "ALTER FOREIGN DATA WRAPPER")
