刪除模式
更新時間 2025-02-14 10:21:48
最近更新時間: 2025-02-14 10:21:48
分享文章
本文為您介紹如何刪除模式。
teledb=# drop schema teledb_schema_owner;
DROP SCHEMA當模式中存在對象時,則會刪除失敗,提示如下。
teledb=# create table teledb_schema_new.test(id int);
CREATE TABLE
teledb=# drop schema teledb_schema_new;
ERROR: cannot drop schema teledb_schema_new because other objects depend on it
DETAIL: table teledb_schema_new.test depends on schema teledb_schema_new
HINT: Use DROP ... CASCADE to drop the dependent objects too.參考如下強制刪除,會將模式中的對象也級聯刪除掉。
teledb=# drop schema teledb_schema_new cascade;
NOTICE: drop cascades to table teledb_schema_new.test
DROP SCHEMA