CHANGE_USER_PRIORITY - 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).

CHANGE_USER_PRIORITY

CHANGE_USER_PRIORITY enables superusers to modify the priority of all queries issued by a user that are either running or waiting in workload management (WLM). Only one user, session, or query can run with the priority CRITICAL.

Syntax

CHANGE_USER_PRIORITY(user_name, priority)

Arguments

user_name

The database user name whose query priority is changed.

priority

The new priority to be assigned to all queries issued by user_name. This argument must be a string with the value CRITICAL, HIGHEST, HIGH, NORMAL, LOW, LOWEST, or RESET. Only superusers can change the priority to CRITICAL. Changing the priority to RESET removes the priority setting for user_name.

Return type

None

Examples

To change the priority for the user analysis_user to LOWEST, use the following example.

SELECT CHANGE_USER_PRIORITY('analysis_user', 'lowest'); +-------------------------------------------------------------------------------------+ | change_user_priority | +-------------------------------------------------------------------------------------+ | Succeeded to change user priority. Changed user (analysis_user) priority to lowest. | +-------------------------------------------------------------------------------------+

To change the priority to LOW, use the following example.

SELECT CHANGE_USER_PRIORITY('analysis_user', 'low'); +----------------------------------------------------------------------------------------------+ | change_user_priority | +----------------------------------------------------------------------------------------------+ | Succeeded to change user priority. Changed user (analysis_user) priority from Lowest to low. | +----------------------------------------------------------------------------------------------+

To reset the priority, use the following example.

SELECT CHANGE_USER_PRIORITY('analysis_user', 'reset'); +-------------------------------------------------------+ | change_user_priority | +-------------------------------------------------------+ | Succeeded to reset priority for user (analysis_user). | +-------------------------------------------------------+