Skip to content

Commit

Permalink
sql: implement write path for ALTER ROLE ... SET
Browse files Browse the repository at this point in the history
ALTER ROLE ... SET will now persist the default settings in the
system.database_role_settings table. The behavior matches Postgres in
the following ways:
- RESET does not validate the setting name.
- SET validates both the name and the proposed default value.
- The defaults are stored in a string array, in key=val format.

The privilege checking is slightly different: we diverge from Postgres
by prohibiting users from modifying their own defaults unless they
have CREATEROLE. This is analogous to our restriction that prevents
a user from modifying their own password. Also, the root and admin roles
can't have their defaults set.

There is no release note since this does not yet affect any
user-behavior. Everything in this commit is write-only

Release note: None
  • Loading branch information
rafiss committed Jul 28, 2021
1 parent 8009ac6 commit 454565b
Show file tree
Hide file tree
Showing 11 changed files with 653 additions and 14 deletions.
14 changes: 7 additions & 7 deletions pkg/bench/rttanalysis/testdata/benchmark_expectations
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ exp,benchmark
24,CreateRole/create_role_with_2_options
25,CreateRole/create_role_with_3_options
23,CreateRole/create_role_with_no_options
20,DropDatabase/drop_database_0_tables
29,DropDatabase/drop_database_1_table
38,DropDatabase/drop_database_2_tables
47,DropDatabase/drop_database_3_tables
28,DropRole/drop_1_role
34,DropRole/drop_2_roles
40,DropRole/drop_3_roles
22,DropDatabase/drop_database_0_tables
31,DropDatabase/drop_database_1_table
40,DropDatabase/drop_database_2_tables
49,DropDatabase/drop_database_3_tables
30,DropRole/drop_1_role
37,DropRole/drop_2_roles
44,DropRole/drop_3_roles
19,DropSequence/drop_1_sequence
27,DropSequence/drop_2_sequences
35,DropSequence/drop_3_sequences
Expand Down
Loading

0 comments on commit 454565b

Please sign in to comment.