刪除模式
更新時間 2025-02-05 09:36:26
最近更新時間: 2025-02-05 09:36:26
分享文章
本文為您介紹如何刪除模式。
您可執行如下操作刪除模式。
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