View a markdown version of this page

CURRENT_USER_ID - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

CURRENT_USER_ID

Returns the unique identifier for the Amazon Redshift user logged in to the current session.

Syntax

CURRENT_USER_ID

Return type

The CURRENT_USER_ID function returns an integer.

Examples

The following example returns the user name and current user ID for this session:

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