CREATE ROLE

Creates a role that bundles privileges and can inherit from a parent role.

Category: securityPrivilege: ManageRolesDeltaForge extension

Syntax

CREATE ROLE [IF NOT EXISTS] <name>
  [INHERIT <parent_role>]
  [COMMENT '<description>']

Description

## Overview CREATE ROLE registers a role principal in the RBAC catalog. Roles are granted to users, groups, and service principals and accumulate object-level privileges via GRANT statements. The optional INHERIT clause establishes a parent role from which privileges flow downward. ## Behavior - Without IF NOT EXISTS, creating a role that already exists raises an error. With IF NOT EXISTS, the existing role is left unchanged. - The parent role must already exist when INHERIT is specified. The Control Plane validates this and rejects the statement if the parent is missing. - A role with INHERIT effectively gains every privilege granted to its parent. Inheritance is transitive: if A inherits from B and B inherits from C, A inherits everything granted to C as well. - Names are validated against `[a-zA-Z_][a-zA-Z0-9_]*`. ## Access Control Requires the `ManageRoles` privilege. ## Compatibility DeltaForge extension.

Parameters

NameTypeDescription
nameSpecifies the role name.
parent_roleSpecifies a parent role. The new role inherits all privileges granted to the parent.
commentOptional human-readable description.
if_not_existsWhen true, succeed silently if a role with this name already exists.

Examples

-- Bare role
CREATE ROLE analyst;
-- Role with a comment
CREATE ROLE data_engineer COMMENT 'Pipeline authors and operators';
-- Role that inherits from a parent
CREATE ROLE data_lead INHERIT data_engineer COMMENT 'Pipeline owners with elevated grants';
-- Idempotent bootstrap
CREATE ROLE IF NOT EXISTS analyst;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →