# man > DROP_SERVER(7)

---
type: CommandReference
command: DROP SERVER
mode: man
section: 7
source: man-pages
---

## Quick Reference

- `DROP SERVER name` — remove a foreign server descriptor
- `DROP SERVER IF EXISTS name` — drop server, no error if missing
- `DROP SERVER name CASCADE` — drop server and all dependents (user mappings)
- `DROP SERVER name RESTRICT` — refuse if any objects depend (default)

## Name

remove a foreign server descriptor

## Synopsis

`DROP SERVER [ IF EXISTS ] _name_ [, ...] [ CASCADE | RESTRICT ]`

## Options

- `IF EXISTS` — do not throw an error if the server does not exist; a notice is issued instead (PostgreSQL extension)
- `_name_` — the name of an existing server
- `CASCADE` — automatically drop objects that depend on the server (e.g., user mappings), and all objects that depend on those objects
- `RESTRICT` — refuse to drop the server if any objects depend on it (default)

## Examples

sql
DROP SERVER IF EXISTS foo;
## See Also

- `CREATE SERVER` — [https://www.postgresql.org/docs/14/sql-createserver.html](https://www.postgresql.org/docs/14/sql-createserver.html)
- `ALTER SERVER` — [https://www.postgresql.org/docs/14/sql-alterserver.html](https://www.postgresql.org/docs/14/sql-alterserver.html)