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
| Parameter | Description |
|---|---|
IF EXISTS | Does not throw an error if the domain does not exist. A notice is issued instead. |
name | The 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. |
CASCADE | Automatically drops objects that depend on the domain (such as table columns), and in turn all objects that depend on those objects. |
RESTRICT | Refuses to drop the domain if any objects depend on it. This is the default. |
Examples
Drop a domain with no dependencies
DROP DOMAIN box;