Postgresql 中文操作指南

37.25. enabled_roles #

视图 enabled_roles 标识当前“启用的角色”。启用的角色被递归定义为当前用户以及所有已授予启用的角色和自动继承的角色。换句话说,这些都是当前用户通过自动继承直接或间接拥有的成员身份的所有角色。

The view enabled_roles identifies the currently “enabled roles”. The enabled roles are recursively defined as the current user together with all roles that have been granted to the enabled roles with automatic inheritance. In other words, these are all roles that the current user has direct or indirect, automatically inheriting membership in.

为了检查权限,“适用角色”集合被应用,它可能比启用的角色集合更广泛。所以通常,最好使用 _applicable_roles_视图而不是这个视图;参阅 Section 37.5了解更多 _applicable_roles_视图的详细信息。

For permission checking, the set of “applicable roles” is applied, which can be broader than the set of enabled roles. So generally, it is better to use the view applicable_roles instead of this one; See Section 37.5 for details on applicable_roles view.

Table 37.23. enabled_roles Columns

Table 37.23. enabled_roles Columns

Column Type

Description

role_name sql_identifier

Name of a role