ERROR: role "data" cannot be dropped because some objects depend on it




PG刪除用戶報錯:

[postgres:7471@postgres] [08-24.19:50:18]=# drop user data;
ERROR:  role "data" cannot be dropped because some objects depend on it
DETAIL:  privileges for schema public


解決方法是回收對public的權限

[postgres:7471@postgres] [08-24.19:52:15]=# revoke create on schema public from data;
REVOKE
Time: 3.884 ms
[postgres:7471@postgres] [08-24.19:52:22]=# drop user data;
DROP ROLE
Time: 1.720 ms

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章