File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
docs/en/sql-reference/10-sql-commands/00-ddl/02-user Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ CREATE [ OR REPLACE ] USER <name> IDENTIFIED [ WITH <auth_type> ] BY '<password>
2121[ WITH MUST_CHANGE_PASSWORD = true | false ]
2222[ WITH SET PASSWORD POLICY = ' <policy_name>' ] -- Set password policy
2323[ WITH SET NETWORK POLICY = ' <policy_name>' ] -- Set network policy
24+ [ WITH SET WORKLOAD GROUP = ' <workload_group_name>' ] -- Set workload group
2425[ WITH DEFAULT_ROLE = ' <role_name>' ] -- Set default role
2526[ WITH DISABLED = true | false ] -- User created in a disabled state
2627```
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ ALTER USER <name> WITH DEFAULT_ROLE = '<role_name>'
4242
4343-- Enable or disable user
4444ALTER USER < name> WITH DISABLED = true | false
45+
46+ -- Set workload group
47+ ALTER USER < name> WITH SET WORKLOAD GROUP = ' <workload_group_name>'
48+
49+ -- Unset workload group
50+ ALTER USER < name> WITH UNSET WORKLOAD GROUP
4551```
4652
4753- * auth_type* can be ` double_sha1_password ` (default), ` sha256_password ` or ` no_password ` .
@@ -154,4 +160,16 @@ SHOW roles
154160│ writer │ 0 │ true │ true │
155161└───────────────────────────────────────────────────────┘
1561623 rows read in 0 .010 sec. Processed 0 rows, 0 B (0 rows/ s, 0 B/ s)
163+ ```
164+
165+ ### Example 2: Setting & Unsetting Workload Group
166+
167+ ``` sql
168+ CREATE USER user1 IDENTIFIED BY ' abc123' ;
169+
170+ ALTER USER user1 WITH SET WORKLOAD GROUP= ' wg' ;
171+
172+ ALTER USER user1 WITH SET WORKLOAD GROUP= ' wg1' ;
173+
174+ ALTER USER user1 WITH UNSET WORKLOAD GROUP;
157175```
You can’t perform that action at this time.
0 commit comments