

 从补丁 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\_USER\_GRANTS
<a name="r_SVV_USER_GRANTS"></a>

使用 SVV\_USER\_GRANTS 查看在集群中被显式授予了角色的用户列表。

SVV\_USER\_GRANTS 对以下用户可见：
+ 超级用户
+ 拥有 ACCESS SYSTEM TABLE 权限的用户

其他用户只能看到明确授予给他们的角色。

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


| 列名称  | 数据类型  | 描述  | 
| --- | --- | --- | 
| user\_id | 整数 | 用户的用户 ID。 | 
| user\_name | 文本 | 用户的名称。 | 
| role\_id | 整数 | 所授予角色的角色 ID。 | 
| role\_name | 文本 | 所授予角色的角色名称。 | 
| admin\_option | 布尔值 | 一个指示用户是否可以向其他用户和角色授予角色的值。 | 

## 示例查询
<a name="r_SVV_USER_GRANTS-sample-queries"></a>

以下查询将向用户授予角色并显示被显式授予了角色的用户列表。

```
GRANT ROLE role1 TO reguser;
GRANT ROLE role2 TO reguser;
GRANT ROLE role1 TO superuser;
GRANT ROLE role2 TO superuser;

SELECT user_name,role_name,admin_option FROM svv_user_grants;

 user_name | role_name | admin_option
-----------+-----------+--------------
 superuser |  role1    | False
 reguser   |  role1    | False
 superuser |  role2    | False
  reguser  |  role2    | False
```