View a markdown version of this page

CURRENT_USER_ID - Amazon Redshift

2026 年 6 月 30 日之后,Amazon Redshift 不再支持使用 Python UDF。我们将分阶段开始执行。有关 Python 生命周期终止和迁移选项详情的更多信息,请参阅 2025 年 6 月 30 日发布的博客文章

CURRENT_USER_ID

返回登录到当前会话的 Amazon Redshift 用户的唯一标识符。

语法

CURRENT_USER_ID

返回类型

CURRENT_USER_ID 函数返回整数。

示例

以下示例返回此会话的用户名和当前用户 ID:

select user, current_user_id; current_user | current_user_id --------------+----------------- dwuser | 1 (1 row)