-
Notifications
You must be signed in to change notification settings - Fork 494
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
Fix dropping role with table privileges granted by non-neon_superuser #10964
base: main
Are you sure you want to change the base?
Conversation
SET LOCAL ROLE neon_superuser; | ||
|
||
revoke_query := format( | ||
'REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA %I FROM {role_name} GRANTED BY neon_superuser;', | ||
'REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA %I FROM {role_name} GRANTED BY neon_superuser', | ||
schema | ||
); | ||
|
||
EXECUTE revoke_query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not at all clear to me why I need to keep this statement around, but if I don't, test_compute_drop_role
will fail. Help in diagnosing this is appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping this statement around tells me there is probably something more to look at than just information_schema.role_table_grants
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried:
FOR grantor IN
SELECT DISTINCT t.grantor
FROM (
SELECT DISTINCT rtg.grantor
FROM information_schema.role_table_grants AS rtg
WHERE grantee = '{role_name}'
UNION
SELECT DISTINCT tp.grantor
FROM information_schema.table_privileges AS tp
WHERE grantee = '{role_name}') AS t
LOOP
But that doesn't work for test_compute_drop_role
.
7755 tests run: 7377 passed, 0 failed, 378 skipped (full report)Flaky tests (3)Postgres 17
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
fff6e6e at 2025-02-27T05:12:05.225Z :recycle: |
We were previously only revoking privileges granted by neon_superuser. However, we need to do it for all grantors. Signed-off-by: Tristan Partin <tristan@neon.tech>
2017f90
to
fff6e6e
Compare
We were previously only revoking privileges granted by neon_superuser. However, we need to do it for all grantors.