fix: cover pg_cron legacy extversion strings with alignment migration and alias scripts - #2300
fix: cover pg_cron legacy extversion strings with alignment migration and alias scripts#2300brainrake wants to merge 2 commits into
Conversation
161319a to
bf7d3ef
Compare
PostgreSQL Package Dependency Analysis: PR #2300
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
PostgreSQL Extension Dependency Analysis: PR #2300
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
This comment has been minimized.
This comment has been minimized.
|
Replaced 21 Removed legacy->legacy and semver->legacy migration versions since those should never be used, only Also fixes a real bug the old renames introduced: |
pg_cron installs recorded with old non-canonical extversion strings (e.g. bare "1.6" instead of "1.6.4") have no update path once the package builds moved to a canonical-version chain, so ALTER EXTENSION pg_cron UPDATE fails with: extension "pg_cron" has no update path from version "1.6" to "1.6.4" Add a legacyVersions table (bare extversion string -> schema-identical canonical version) that generates one empty alignment migration per entry, restoring a resolvable upgrade path for every legacy string this packaging has shipped as default_version. The table is shared via passthru so the nixos test consumes the exact same data that generates the files, instead of re-discovering the alias graph from disk. Also fixes a real gap in the existing canonical chain: 1.3--1.4 was renamed to 1.3.1--1.4.2, silently skipping the GRANT SELECT ON cron.jobid_seq/runid_seq statements that only exist in upstream's 1.4--1.4-1 script. Renamed to 1.3.1--1.4.0 instead, with a new 1.4.1--1.4.2 alignment migration reconnecting the chain. Test: check_legacy_versions_upgrade_to_latest installs the canonical version, patches pg_extension.extversion to the legacy string directly (reproducing actual field state), and asserts a bare ALTER EXTENSION UPDATE lands on latest. Supersedes #1790. Co-Authored-By: Sam Rose <samuel@supabase.io>
6a3eb2d to
cbb9331
Compare
Summary
Supersedes #1790
pg_cron--1.6--1.6.4.sqlalignment migration plus symlinked alias scripts for every extversion string pg_cron has shipped under (1.0,1.1,1.2,1.3,1.4,1.4-1,1.5), restoring a resolvableALTER EXTENSION pg_cron UPDATEpath for projects still recording one of these old version strings.testAllUpgradeEdgesnix/ext test mode that discovers and exercises every upgrade edge on disk (including symlinked aliases and no-op alignment scripts), not just the canonical chain fromversions.json.Root cause / customer impact: supabase/supabase#46669 — in-place PG upgrades fail at the completion step with
extension "pg_cron" has no update path from version "1.6" to "1.6.4"for any project whose pg_cron extension is still recorded at the bare1.6version.Test plan
supadevupgrade smoke test needs an already-released AMI, and a freshly created test project would get canonical pg_cron out of the box (not the legacy string this fix targets), so it wouldn't exercise the bug anyway. Covered instead by the new nixos test, which patchespg_extension.extversionto each legacy string directly and asserts the upgrade completes.Fixes PSQL-1414