↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / SQL Commands

DROP DOMAIN

remove a domain

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-DROPDOMAIN
file
sql-dropdomain.html
lang
en
name
DROP DOMAIN
purpose
remove a domain
purpose zh
移除一个域
sections same as
Unknown
slug
18
synopsis html
DROP DOMAIN [ IF EXISTS ] <em class="replaceable"><code>name</code></em> [, ...] [ CASCADE | RESTRICT ]
synopsis text
DROP DOMAIN [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

Syntax

DROP DOMAIN [ 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 DOMAIN IF EXISTS name , CASCADE RESTRICT

Definition PG 18

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

Description

DROP DOMAIN removes a domain. Only the owner of a domain can remove it.

Parameters

IF EXISTS

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

name

The name (optionally schema-qualified) of an existing domain.

CASCADE

Automatically drop objects that depend on the domain (such as table columns), and in turn all objects that depend on those objects (see Section 5.15).

RESTRICT

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

Examples

To remove the domain box:

DROP DOMAIN box;

Compatibility

This command conforms to the SQL standard, except for the IF EXISTS option, which is a PostgreSQL extension.

See Also

CREATE DOMAIN, ALTER DOMAIN

Compare versions

Source references

Full definition and evidence JSON

Definition sources

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

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