Fix CREATE EXTENSION on PG16+ without a superuser (RDS/Aurora) (#14)#18
Open
jnasbyupgrade wants to merge 3 commits into
Open
Fix CREATE EXTENSION on PG16+ without a superuser (RDS/Aurora) (#14)#18jnasbyupgrade wants to merge 3 commits into
jnasbyupgrade wants to merge 3 commits into
Conversation
Adds the Claude Code GitHub Actions workflows: `claude.yml` (@claude mentions) and `claude-code-review.yml` (auto-review on PRs from the jnasbyupgrade fork via pull_request_target, gated to that fork). Requires the `CLAUDE_CODE_OAUTH_TOKEN` secret on this repo and the Claude GitHub App granted access. Part of enabling Claude Code review across the postgresql-extensions repos. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ruser As of PG16, CREATE ROLE no longer grants the creating role a SET-enabled membership in the new role, so the install's `SET ROLE test_factory__owner` fails unless the current role is a superuser (which bypasses the check). This surfaces only on non-superuser installs (e.g. RDS/Aurora). Grant the role back to the installing role WITH SET, gated on PG16+ (pre-16 GRANT already permits SET ROLE). Unconditional, so it also covers a pre-existing role where CREATE ROLE was a no-op. Fixes Postgres-Extensions#14 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Postgres-Extensions#14) The failure can't be reproduced under pg_regress, which runs as a superuser that bypasses the SET ROLE check. Instead assert the state the fix establishes: after install the installing role holds a SET-enabled membership in test_factory__owner (PG16+; skipped with identical output pre-16). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
024fff0 to
fcec706
Compare
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.
CREATE EXTENSION test_factoryfails on PostgreSQL 16+ when installed by a non-superuser role:As of PG16,
CREATE ROLEno longer grants the creating role a SET-enabled membership in the new role, so the install'sSET ROLE test_factory__owneris rejected. A superuser bypasses the check, so this only surfaces for non-superuser installs (e.g. RDS/Aurora).Fix: after creating the role, grant it back to the installing role WITH SET, gated on PG16+ (pre-16
GRANT ... TOalready permitsSET ROLE). The grant is unconditional so it also covers the case where the role already existed.The failure can't be reproduced under
pg_regress, which runs as a superuser, so the added test instead asserts the SET-enabled membership the fix establishes.Fixes #14
🤖 Generated with Claude Code