Repository navigation
Keep reinstalls from widening the standard env - #13
Merged
Merged
Conversation
A consumer who installed 0.0.2 upgrades by running the next artifact over it, and nothing so far checked that this works or that it leaves their own registrations alone. Releasing without that check is how the first broken upgrade reaches a database nobody can reinstall casually. The upgrade workflow installs the latest published release through each shipped channel, registers a consumer overload, upgrades to the build at hand -- psql over the old schema, or pg_tle's ALTER EXTENSION UPDATE through a registered update path -- and then runs the whole suite against the upgraded database, since an upgraded install has to be exactly as conformant as a fresh one. CI runs it on every pull request so a breaking change is caught where it is made, and the release workflow's publish job needs it, so no tag is cut without it. The upgrade is the idempotent installer alone. The delta-script convention for drops and signature changes stays unbuilt until a release needs one; this job is what will say so.
The core scripts enable "every overload, type and macro registered so far" in standard. On a fresh install that is the core alone, because the extension scripts run afterwards. But the installer is also the upgrade, and run over an installed schema the same sweep picks up every extension's items and every consumer registration: upgrading 0.0.2 in place put 139 extension overloads, 16 macros and 3 types into standard, plus the consumer's own overload. The suite stayed green, because a wider env breaks no corpus case -- which is exactly the failure CLAUDE.md warns about. The sweep now takes only rows no env claims yet whose implementation lives in the cel schema, and the installer drops from standard what a shipped extension env also lists, repairing schemas already reinstalled. A consumer row swept in earlier cannot be told from one put in standard on purpose, so it stays. The upgrade check asserts standard comes out of an upgrade as narrow as it went in. The origin column of rds-distribution decision 7 is the general fix; this guard is what the installer needs until it lands.
This was referenced Oct 30, 2026
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.
Stacked on #12. Merge #12 first. Until it lands, this diff also includes #12's commit.
Bug
The upgrade job from #12 turned this up. The core scripts (
030,060,070) put "everything registered so far" into thestandardenv:On a fresh install that set is just the core, because the extension scripts run afterwards. But the installer is also the upgrade path. Running it over an existing schema picks up every extension's items and every consumer registration. An in-place upgrade from 0.0.2 put 139 extension overloads, 16 macros and 3 types into
standard, and the consumer's own overload as well. The conformance suite stayed green, because a wider env doesn't break any corpus case. That is the "extension enabled by default in standard" failure CLAUDE.md warns about.This hits anyone who re-runs a bundle over an installed schema. fga4postgres updating its vendored bundle is one such case.
Fix
cel._unclaimed(kind, ref, impl): the sweeps now pick only rows that no env claims yet and whose implementation (if there is one) lives in thecelschema.standardanything a shipped extension env also lists. This is idempotent, and it matches nothing on a fresh install. A consumer row that an earlier reinstall swept intostandardcan't be told apart from one a user put there deliberately, so those are left alone.scripts/upgrade-check.shnow asserts that after an upgrade,standardcontains neither the consumer overload nor any item that another env also lists.Rds-distribution decision 7 (an
origincolumn) is still the general fix. This guard covers the gap until that lands.Verified locally
go test ./...passes against the fresh database and both upgraded databases.shellcheckandbuild-release.shboth pass.