DROP DOMAIN 是一个用于删除域的 DDL 命令。
DROP DOMAIN 在 PostgreSQL 7.3 中添加。
变更历史
- PostgreSQL 8.2
- 添加了
DROP DOMAIN IF EXISTS ...语法 (提交 daea4d8e)
- 添加了
- PostgreSQL 7.3
- 已添加(提交 01c76f74)
示例
尝试删除正在使用的域
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.
删除正在使用的域
postgres=# DROP DOMAIN git_sha1 CASCADE; NOTICE: drop cascades to column commit_ref of table repo_commit_ref DROP DOMAIN
参考资料
- PostgreSQL文档: DROP DOMAIN
