

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 Python UDF。现有的 Python UDF 将继续正常运行至 2026 年 6 月 30 日。有关更多信息，请参阅[博客文章](https://www.amazonaws.cn/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

# SVV\_RLS\_ATTACHED\_POLICY
<a name="r_SVV_RLS_ATTACHED_POLICY"></a>

使用 SVV\_RLS\_ATTACHED\_POLICY 以查看已在当前连接的数据库上附加了一个或多个行级别安全性策略的所有关系和用户的列表。

只有拥有 sys:secadmin 角色的用户才能查询此视图。

## 表列
<a name="r_SVV_RLS_ATTACHED_POLICY-table-columns"></a>


| 列名称  | 数据类型  | 说明 | 
| --- | --- | --- | 
| relschema | 文本 | 行级别安全性策略附加到的关系的架构的名称。 | 
| relname | 文本 | 行级别安全性策略附加到的关系的名称。 | 
| relkind | 文本 | 对象的类型，如表。 | 
| polname | 文本 | 附加到关系的行级别安全性策略的名称。 | 
| grantor | 文本 | 已附加此策略的用户的名称。 | 
| grantee | 文本 | 此策略已附加到的用户或角色的名称。 | 
| granteekind | 文本 | 被授权者的类型。可能的值为用户或角色。 | 
| is\_pol\_on | 布尔值 | 指示是否在表上打开或关闭行级别安全性策略的参数。可能的值包括 true 和 false。 | 
| is\_rls\_on | 布尔值 | 指示是否在表上打开或关闭行级别安全性的参数。可能的值包括 true 和 false。 | 
| rls\_conjunction\_type | character(3) | 指示关系是使用 and 还是 or 合并 RLS 策略的参数。 | 

## 示例查询
<a name="r_SVV_RLS_ATTACHED_POLICY-sample-query"></a>

以下示例显示了 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 | rls_conjuntion_type
-----------+--------------------------+---------+-----------------+---------+----------+-------------+-----------+-----------+---------------------
 public    | tickit_category_redshift |  table  | policy_concerts |   bob   |  analyst |    role     |    True   |    True   |      and
 public    | tickit_category_redshift |  table  | policy_concerts |   bob   |  dbadmin |    role     |    True   |    True   |      and
```