Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

CURRENT_SETTING - Amazon Redshift
This page has not been translated into your language. Request translation

CURRENT_SETTING

CURRENT_SETTING returns the current value of the specified configuration parameter.

This function is equivalent to the SHOW command.

Syntax

current_setting('parameter')

The following statement returns the current value of the specified session context variable.

current_setting('variable_name') current_setting('variable_name'[, error_if_undefined])

Arguments

parameter

Parameter value to display. For a list of configuration parameters, see Configuration reference

variable_name

The name of the variable to display. This must be a string constant for session context variables.

error_if_undefined

(Optional) A boolean value that specifies the behavior if the variable name doesn't exist. When error_if_undefined is set to TRUE, which is the default, Amazon Redshift throws an error. When error_if_undefined is set to FALSE, Amazon Redshift returns NULL. Amazon Redshift supports the error_if_undefined parameter only for session context variables. This can't be used when the input is a configuration parameter.

Return type

Returns a CHAR or VARCHAR string.

Examples

To return the current setting for the query_group parameter, use the following example.

SELECT CURRENT_SETTING('query_group'); +-----------------+ | current_setting | +-----------------+ | unset | +-----------------+

To return the current setting for the variable app_context.user_id, use the following example.

SELECT CURRENT_SETTING('app_context.user_id', FALSE);
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.