feat: grant REINDEX capability to analytics user in read-write mode#15
Merged
feat: grant REINDEX capability to analytics user in read-write mode#15
Conversation
- PG < 16 read-write: use superuser (pg_maintain doesn't exist) - PG >= 16 read-write: grant pg_maintain for REINDEX/VACUUM/ANALYZE - PG >= 14 read-only: unchanged (pg_read_all_data only) - PG < 14: unchanged (superuser)
5d745ef to
35df1b5
Compare
|
🦸 Review Hero Summary |
|
🦸 Review Hero Auto-Fix |
|
🦸 Review Hero Summary No issues found. Looks good! ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grant the analytics user the ability to run
REINDEXcommands whenreadOnly: false.Changes to privilege model:
pg_read_all_data(unchanged)pg_write_all_data+CREATE ON DATABASE)pg_read_all_data(unchanged)pg_read_all_data+pg_write_all_data+pg_maintain+CREATE ON DATABASE(new:pg_maintain)PG 14-16 read-write is promoted to superuser because
pg_maintainwas only introduced in PG 17. This matches the existing PG < 14 behavior.Testing: Added a
REINDEX TABLEassertion to the existinganalytics_create_schema_read_writeintegration test.🦸 Review Hero