Description
This document introduces the SQL syntax for creating custom roles and replacing existing roles.
Syntax
- CREATE: Create a new role.
- OR REPLACE (optional): If a role with the same name already exists, replace that role.
- IF NOT EXISTS (optional): If the specified role name does not exist, create a new role. If the role already exists, no error will be reported, and no new role will be created.
- role_name: Specify the name of the new role. Note that the role name cannot be the same as the system predefined role names.
- COMMENT (optional): Add a comment to the role, which can be left blank or provide information about the role.
Example
- Create a custom role named
simple_role: - Create a role named
admin_roleand add a comment to it:
Instance Role Management
LakeHouse supports creating roles at the instance level to achieve unified permission control across workspaces, meeting the needs for fine-grained access control in multi-team collaboration scenarios. This operation requires INSTANCE_ADMIN privileges.
