

 从补丁 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\_RELATION
<a name="r_SVV_RLS_RELATION"></a>

使用 SVV\_RLS\_RELATION 以查看受 RLS 保护的所有关系的列表。

SVV\_RLS\_RELATION 对所有用户可见。超级用户可以查看所有行；普通用户只能查看其自己的数据。有关更多信息，请参阅 [系统表和视图中的数据可见性](cm_chap_system-tables.md#c_visibility-of-data)。

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


| 列名称  | 数据类型  | 说明 | 
| --- | --- | --- | 
| datname | 文本 | 包含关系的数据库的名称。 | 
| relschema | 文本 | 包含关系的架构的名称。 | 
| relname | 文本 | 关系的名称。 | 
| relkind | 文本 | 关系的类型，如表或视图。 | 
| is\_rls\_on | 布尔值 | 指示关系是否受 RLS 保护的参数。 | 
| is\_rls\_datashare\_on | 布尔值 | 指示关系是否受通过数据共享实施的 RLS 保护的参数。 | 
| rls\_conjunction\_type | character(3) | 指示关系是使用 and 还是 or 合并 RLS 策略的参数。 | 
| rls\_datashare\_conjunction\_type | character(3) | 指示关系是使用 and 还是 or 通过数据共享合并 RLS 策略的参数。 | 

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

以下示例显示了 SVV\_RLS\_RELATION 的结果。

```
ALTER TABLE tickit_category_redshift ROW LEVEL SECURITY ON FOR DATASHARES;       

            
--Inspect RLS state on the relations using SVV_RLS_RELATION.
SELECT datname, relschema, relname, relkind, is_rls_on, is_rls_datashare_on FROM svv_rls_relation ORDER BY relname;

  datname  | relschema |        relname           | relkind | is_rls_on | is_rls_datashare_on | rls_conjunction_type | rls_datashare_conjunction_type
-----------+-----------+--------------------------+---------+-----------+---------------------+----------------------+--------------------------------
 tickit_db |   public  | tickit_category_redshift |  table  |      t    |           t         |          and         |              and
(1 row)
```