SVV_RLS_ATTACHED_POLICY
使用 SVV_RLS_ATTACHED_POLICY 以查看已在当前连接的数据库上附加了一个或多个行级别安全性策略的所有关系和用户的列表。
只有拥有 sys:secadmin 角色的用户才能查询此视图。
表列
| 列名称 | 数据类型 | 描述 |
|---|---|---|
| relschema | text | 行级别安全性策略附加到的关系的架构的名称。 |
| relname | text | 行级别安全性策略附加到的关系的名称。 |
| relkind | text | 对象的类型,如表。 |
| polname | text | 附加到关系的行级别安全性策略的名称。 |
| grantor | text | 已附加此策略的用户的名称。 |
| grantee | text | 此策略已附加到的用户或角色的名称。 |
| granteekind | text | 被授权者的类型。可能的值为用户或角色。 |
| is_pol_on | 布尔值 | 指示是否在表上打开或关闭行级别安全性策略的参数。可能的值包括 true 和 false。 |
| is_rls_on | 布尔值 | 指示是否在表上打开或关闭行级别安全性的参数。可能的值包括 true 和 false。 |
示例查询
以下示例显示了 SVV_RLS_ATTACHED_POLICY 的结果。
--Inspect the policy in SVV_RLS_ATTACHED_POLICY SELECT * FROM svv_rls_attached_policy; relschema | relname | relkind | polname | grantor | grantee | granteekind | is_pol_on | is_rls_on -----------+--------------------------+---------+-----------------+---------+----------+-------------+-----------+----------- public | tickit_category_redshift | table | policy_concerts | bob | analyst | role | True | True public | tickit_category_redshift | table | policy_concerts | bob | dbadmin | role | True | True