dropuser

用于删除数据库用户的核心工具

dropuser 是一个用于删除(移除)数据库用户的核心工具,本质上是DROP ROLE命令的封装。

dropuserPostgreSQL 7.0中添加。

用法

dropuser 在成功删除用户时不会发出任何输出。

源代码

dropuser 的源代码位于 src/bin/scripts/dropuser.c

变更历史

示例

dropuser 的基本用法示例

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

postgres=# \q

postgres$ dropuser -h localhost newuser

psql (14.3)
Type "help" for help.

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

分类

核心工具, 用户和角色

另请参阅

DROP ROLE, DROP USER, createuser

反馈

请在此处提交有关“dropuser”的任何评论、建议或更正。here