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.”

HAS_SCHEMA_PRIVILEGE - Amazon Redshift

HAS_SCHEMA_PRIVILEGE

Returns true if the user has the specified privilege for the specified schema. For more information about privileges, see GRANT.

Syntax

Note

This is a leader-node function. This function returns an error if it references a user-created table, an STL or STV system table, or an SVV or SVL system view.

has_schema_privilege( [ user, ] schema, privilege)

Arguments

user

The name of the user to check for schema privileges. The default is to check the current user.

schema

The schema associated with the privilege.

privilege

The privilege to check. Valid values are the following:

  • CREATE

  • USAGE

Return type

Returns a CHAR or VARCHAR string.

Example

The following query confirms that the GUEST user has the CREATE privilege on the PUBLIC schema:

select has_schema_privilege('guest', 'public', 'create'); has_schema_privilege ---------------------- true (1 row)
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.