DROP DOMAIN

A DDL command for removing a domain

DROP DOMAIN is a DDL command for removing a domain.

DROP DOMAIN was added in PostgreSQL 7.3.

Change history

Examples

Attempting to drop a domain which is in use:

postgres=# DROP DOMAIN git_sha1 ;
ERROR:  cannot drop type git_sha1 because other objects depend on it
DETAIL:  column commit_ref of table repo_commit_ref depends on type git_sha1
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

Dropping a domain which is in use:

postgres=# DROP DOMAIN git_sha1 CASCADE;
NOTICE:  drop cascades to column commit_ref of table repo_commit_ref
DROP DOMAIN

Categories

Data type, DDL, SQL command

See also

CREATE DOMAIN, ALTER DOMAIN