↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / SQL Commands

DROP SERVER

remove a foreign server descriptor

English manual coverage begins with PostgreSQL 6.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

anchor
SQL-DROPSERVER
file
sql-dropserver.html
lang
en
name
DROP SERVER
purpose
remove a foreign server descriptor
purpose zh
移除一个外部服务器描述符
sections same as
Unknown
slug
18
synopsis html
DROP SERVER [ IF EXISTS ] <em class="replaceable"><code>name</code></em> [, ...] [ CASCADE | RESTRICT ]
synopsis text
DROP SERVER [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

Syntax

DROP SERVER [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
Syntax diagrams

Read left to right. Branches are choices, bypasses are optional, loops repeat. Select an underlined parameter to open its rule.

DROP SERVER IF EXISTS name , CASCADE RESTRICT

Definition PG 18

DROP SERVER [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

Description

DROP SERVER removes an existing foreign server descriptor. To execute this command, the current user must be the owner of the server.

Parameters

IF EXISTS

Do not throw an error if the server does not exist. A notice is issued in this case.

name

The name of an existing server.

CASCADE

Automatically drop objects that depend on the server (such as user mappings), and in turn all objects that depend on those objects (see Section 5.15).

RESTRICT

Refuse to drop the server if any objects depend on it. This is the default.

Examples

Drop a server foo if it exists:

DROP SERVER IF EXISTS foo;

Compatibility

DROP SERVER conforms to ISO/IEC 9075-9 (SQL/MED). The IF EXISTS clause is a PostgreSQL extension.

See Also

CREATE SERVER, ALTER SERVER

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:dcc162d9d45739b2577e0e8c18b36149d8a38dccdc40e616778ce13c2c2810b8

Text language: en · wiki-repair-20261023:dcc162d9d45739b2577e0e8c18b36149d8a38dccdc40e616778ce13c2c2810b8