作者:瀚高PG實驗室 (Highgo PG Lab)- 徐云鶴
洗掉用戶可以使用如下命令:
drop user postgres1;
如果提示如下內容則說明該用戶下有所屬物件,
postgres=# drop user postgres1 ;
ERROR: role "postgres1" cannot be dropped because some objects depend on it
需要通過如下兩條命令進行洗掉,
drop owned by postgres1 cascade;
drop user postgres1;
將想洗掉的用戶名替換postgres1即可,
洗掉前確保連接的資料庫正確,執行洗掉命令前需三思而后行~~
截至PG13,沒有 drop user postgres1 cascade;命令,以后應該也不會有,
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/237131.html
標籤:其他
上一篇:資料庫常用優化方案
下一篇:MySQL主從復制詳細操作
