SELECT
m.roleid AS member_role_id,
r.rolname AS member_role_name,
m.roleid AS granted_role_id,
g.rolname AS granted_role_name
FROM
pg_auth_members m
JOIN
pg_roles r ON m.roleid = r.oid
JOIN
pg_roles g ON m.member = g.oid
WHERE
m.roleid = 'pg_write_all_data'::regrole; -- Replace 'pg_write_all_data' with the OID of the role if needed
1条答案
按热度按时间vs91vp4v1#
在
PostgreSQL
中,可以查询系统目录表以查找有关角色成员身份和权限的信息。具体而言,可以检查pg_roles
和pg_auth_members
表以确定哪些角色已被授予pg_write_all_data
角色。下面是一个你可以用途:的查询
字符串