Updates an existing user's default role or comment.
ALTER USER <name> [SET]
[DEFAULT_ROLE = <role>]
[COMMENT '<description>']
## Overview ALTER USER updates mutable attributes of an existing user. Only DEFAULT_ROLE and COMMENT are changeable through SQL. The user's name and the underlying identity-provider link are managed elsewhere. ## Behavior - The user must already exist; otherwise the ALTER raises an error. - At least one of DEFAULT_ROLE or COMMENT must be supplied. ALTER USER with neither clause is rejected. - The SET keyword is optional and accepted for syntactic familiarity. Whether it is present or absent, the body is the same. - DEFAULT_ROLE must reference an existing role. Setting an unknown role fails at the Control Plane and leaves the user unchanged. - Partial updates are supported: changing only DEFAULT_ROLE leaves COMMENT alone, and vice versa. ## Access Control Requires the `ManageUsers` privilege. ## Compatibility DeltaForge extension.
| Name | Type | Description |
|---|---|---|
name | Specifies the user to alter. Must already exist. | |
default_role | Specifies the new default role. The role must already exist. | |
comment | Specifies a new description. Pass an empty string to clear. |
-- Change a user's default role
ALTER USER bob SET DEFAULT_ROLE = data_lead;
-- Update the comment without changing the default role
ALTER USER bob SET COMMENT 'Promoted 2026-04';
-- Both clauses at once
ALTER USER bob SET DEFAULT_ROLE = data_lead COMMENT 'Promoted 2026-04';