Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: support ALTER ROLE ... RENAME TO ... #50821

Open
solongordon opened this issue Jun 30, 2020 · 4 comments
Open

sql: support ALTER ROLE ... RENAME TO ... #50821

solongordon opened this issue Jun 30, 2020 · 4 comments
Labels
A-sql-privileges SQL privilege handling and permission checks. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@solongordon
Copy link
Contributor

solongordon commented Jun 30, 2020

CockroachDB currently does not support renaming an existing role directly. In order to do so, you need to create a new role with the same privileges and then drop the old one.

Supporting rename is not trivial as it stands because all privileges are keyed off of the role name. This is made more difficult by the fact that privileges are stored directly on descriptors, not in system tables.

Jira issue: CRDB-4084

Epic CRDB-25679

@solongordon solongordon added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-privileges SQL privilege handling and permission checks. labels Jun 30, 2020
@solongordon
Copy link
Contributor Author

@awoods187 pointed out we could also consider implementing this by having a job which walked through the steps a user would do manually: creating the new role, granting the same privileges, assigning other roles to it, etc. That would still take some care to get right but would not require a larger overhaul to how we store privileges.

@rafiss rafiss added this to Triage in SQL Sessions - Deprecated via automation Jul 20, 2021
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Jul 20, 2021
@rafiss rafiss moved this from Triage to Longer term backlog in SQL Sessions - Deprecated Jul 20, 2021
@rafiss rafiss moved this from Longer term backlog to January 2021 in SQL Sessions - Deprecated Feb 4, 2022
@RichardJCai RichardJCai moved this from February 2021 to Potentially for 22.2 in SQL Sessions - Deprecated Apr 12, 2022
@RichardJCai
Copy link
Contributor

Depends on the work here:
#78963

@RichardJCai RichardJCai moved this from 22.2 Now to Blocked in SQL Sessions - Deprecated Apr 26, 2022
@RichardJCai
Copy link
Contributor

Let's wait for 23.1 to make thing's simpler - once the role_id work is in and has baked for a version such that we're guaranteed to have role ids.

@AndrewSouthpaw
Copy link

Just ran into this limitation. The workaround isn't so bad, but it'd be nice to see this in CRDB at some point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-privileges SQL privilege handling and permission checks. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
No open projects
Development

No branches or pull requests

6 participants