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

USER_IS_MEMBER_OF

Returns true if the user is a member of a role or group. Superusers can check the membership of all users. Regular users who are members of the sys:secadmin or sys:superuser role can check all users' membership. Otherwise, regular users can only check themselves. Amazon Redshift sends an error if the provided identities don't exist or the current user doesn't have access to the role.

Syntax

user_is_member_of( user_name, role_name | group_name)

Arguments

user_name

The name of the user.

role_name

The name of the role.

group_name

The name of the group.

Return type

Returns a BOOLEAN.

Example

The following query confirms that the user isn't a member of role1.

SELECT user_is_member_of('reguser', 'role1'); user_is_member_of ------------------- False