Fix 0.2.3->0.3.0 update script: missing enum grant, drifted comments - #68
Merged
jnasbyupgrade merged 2 commits intoAug 2, 2026
Conversation
Grant USAGE on five pre-0.2.2 enum types (constraint_type, procedure_type, relation_type, relation_relkind, object_type) to cat_tools__usage: the ALTER DEFAULT PRIVILEGES near the top of sql/cat_tools.sql.in only covers objects created after it runs, and these types were created back in 0.2.0/0.2.1, before that statement exists at all in this update path. A database that reached 0.2.3 via the 0.2.0/0.2.1 legacy update scripts is still missing the grant; a fresh install is unaffected since it creates these types after the grant. Both 0.2.0->0.2.2 and 0.2.1->0.2.2 are already-tagged, frozen scripts, so the fix converges forward here, on the first still-unreleased update script downstream of the gap. The GRANT is idempotent, so it is a no-op for every other origin. Also bring roughly a dozen functions in this update script back in sync with the canonical fresh-install source (sql/cat_tools.sql.in) -- missing or stale comments, a missing version-gating marker on the 'event trigger' case branch, and blank-line grouping that had drifted out of step over time. Purely cosmetic; confirmed via direct diff against cat_tools.sql.in, no logic changes. Both issues were surfaced by the new structural-comparison tool being added in Postgres-Extensions#55, which diffs a fresh install of a version against an update-path install of the same version and flags any divergence. That PR is scoped to the tool itself; this is the update-script fix it uncovered, split out on its own. Verified locally: make lint, make verify-results (fresh install), and make verify-results TEST_LOAD_SOURCE=update (0.2.2->current, the exact path through this file) all pass. Also ran PR Postgres-Extensions#55's structural_diff tool by hand against a fresh-current install and a 0.2.2-updated-to-current install: zero divergence. The 0.2.0/0.2.1-origin legacy path (which the enum-grant fix specifically targets) needs PG10 to install fresh and this container only has PG12/PG17, so that leg could not be exercised locally; CI's extension-update-test job covers it on PG10. Co-Authored-By: Claude Sonnet 5 <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:
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 |
The previous commit fixed a real, user-facing gap (databases updated from 0.2.0/0.2.1 never got the cat_tools__usage grant on five pre-0.2.2 enum types), so it belongs in the changelog users read before updating, not just in the commit message.
|
I'll analyze this and get back to you. |
jnasbyupgrade
merged commit Aug 2, 2026
e62d9e3
into
Postgres-Extensions:master
11 of 12 checks passed
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 USAGE on five pre-0.2.2 enum types (constraint_type, procedure_type, relation_type, relation_relkind, object_type) to cat_tools__usage: the ALTER DEFAULT PRIVILEGES near the top of sql/cat_tools.sql.in only covers objects created after it runs, and these types were created back in 0.2.0/0.2.1, before that statement exists at all in this update path. A database that reached 0.2.3 via the 0.2.0/0.2.1 legacy update scripts is still missing the grant; a fresh install is unaffected since it creates these types after the grant. Both 0.2.0->0.2.2 and 0.2.1->0.2.2 are already-tagged, frozen scripts, so the fix converges forward here, on the first still-unreleased update script downstream of the gap. The GRANT is idempotent, so it is a no-op for every other origin.
Also brings roughly a dozen functions in this update script back in sync with the canonical fresh-install source (sql/cat_tools.sql.in) -- missing or stale comments, a missing version-gating marker on the 'event trigger' case branch, and blank-line grouping that had drifted out of step over time. Purely cosmetic; confirmed via direct diff against cat_tools.sql.in, no logic changes.
Both issues were surfaced by the new structural-comparison tool being added in #55, which diffs a fresh install of a version against an update-path install of the same version and flags any divergence. That PR is scoped to the tool itself; this is the update-script fix it uncovered, split out on its own so #55 stays pure infra.
sql/cat_tools--0.2.3--0.3.0.sql.inis safe to edit here because 0.3.0 has not been tagged/released yet (tags stop at 0.2.3).Test plan
make lintmake verify-results(fresh install of current version)make verify-results TEST_LOAD_SOURCE=update(0.2.2 -> current, the exact path through this file)bin/structural_diffby hand against a fresh-current install and a 0.2.2-updated-to-current install: zero divergenceextension-update-testjob covers it on PG10🤖 Generated with Claude Code