如何在postgres中删除超级用户

时间:2018-03-24 07:34:08

标签: postgresql postgresql-9.6

我创建了一个具有超级用户角色的新用户rentdb,当我尝试删除时,我会得到它与某些pg函数有关的依赖关系。 有没有办法可以完全删除rentdb。

  postgres-# \du
                                   List of roles
 Role name |                         Attributes                         | Member of 
-----------+------------------------------------------------------------+-----------
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 rentdb    | Superuser                                                  | {}

1 个答案:

答案 0 :(得分:0)

As documented in the manual您可以{}为用户拥有的drop everything

drop owned by rentdb cascade;

assign将这些对象发送给其他用户:

reassign owned by rentdb to postgres;