All Products
Search
Document Center

PolarDB:DROP DOMAIN

Last Updated:Mar 27, 2026

Use DROP DOMAIN to remove a domain from the database.

Usage notes

Only the owner of a domain can remove it.

Synopsis

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

Parameters

ParameterDescription
IF EXISTSDoes not throw an error if the domain does not exist. A notice is issued instead.
nameThe name of an existing domain. Optionally schema-qualified. If the domain does not exist, an error is raised unless IF EXISTS is set. If any objects depend on the domain, an error is raised unless CASCADE is set.
CASCADEAutomatically drops objects that depend on the domain (such as table columns), and in turn all objects that depend on those objects.
RESTRICTRefuses to drop the domain if any objects depend on it. This is the default.

Examples

Drop a domain with no dependencies

DROP DOMAIN box;

What's next