Skip to main content
Skip to main content

SET ROLE Statement

Activates roles for the current user.

SET DEFAULT ROLE

Sets default roles to a user.

Default roles are automatically activated at user login. You can set as default only the previously granted roles. If the role isn't granted to a user, ClickHouse throws an exception.

Examples

Set multiple default roles to a user:

Set all the granted roles as default to a user:

Purge default roles from a user:

Set all the granted roles as default except for specific roles role1 and role2: