postgres role drop fail

----------- 删除用户失败 -----------

DROP USER yinglong;
ERROR: role "yinglong" cannot be dropped because some objects depend on it
DETAIL: privileges for default privileges on new relations belonging to role postgres in schema public

方法:

postgres=# \ddp

Default access privileges
Owner | Schema | Type | Access privileges
----------+--------+----------+---------------------------
postgres | public | sequence | postgres=rwU/postgres
postgres | public | table | postgres=arwdDxt/postgres+
| | | yinglong=Dxt/postgres

postgres=# REASSIGN OWNED BY yinglong TO postgres;
REASSIGN OWNED

postgres=# DROP OWNED BY yinglong;
DROP OWNED

postgres=# \ddp
Default access privileges
Owner | Schema | Type | Access privileges
----------+--------+----------+---------------------------
postgres | public | sequence | postgres=rwU/postgres
postgres | public | table | postgres=arwdDxt/postgres
(2 rows)

 

 

 

 

此条目发表在db分类目录。将固定链接加入收藏夹。