Skip to content

Fix 0.2.3->0.3.0 update script: missing enum grant, drifted comments - #68

Merged
jnasbyupgrade merged 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-0.2.3-0.3.0-update-script
Aug 2, 2026
Merged

Fix 0.2.3->0.3.0 update script: missing enum grant, drifted comments#68
jnasbyupgrade merged 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-0.2.3-0.3.0-update-script

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

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.in is safe to edit here because 0.3.0 has not been tagged/released yet (tags stop at 0.2.3).

Test plan

  • make lint
  • make verify-results (fresh install of current version)
  • make verify-results TEST_LOAD_SOURCE=update (0.2.2 -> current, the exact path through this file)
  • Ran Check for structural differences between CREATE and UPDATE EXTENSION #55's bin/structural_diff 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; this dev container only has PG12/PG17 so that leg could not be exercised locally -- CI's extension-update-test job covers it on PG10

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ca967b33-6edb-430f-8be1-e0526883d312

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@jnasbyupgrade
jnasbyupgrade merged commit e62d9e3 into Postgres-Extensions:master Aug 2, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant