fix(config): add PG17 image mapping for db dump#5083
Open
nanookclaw wants to merge 4 commits intosupabase:mainfrom
Open
fix(config): add PG17 image mapping for db dump#5083nanookclaw wants to merge 4 commits intosupabase:mainfrom
nanookclaw wants to merge 4 commits intosupabase:mainfrom
Conversation
* feat(declarative): add tests for skipping config updates when PgDelta is enabled - These tests verify that the configuration remains unchanged when PgDelta is enabled, ensuring the declarative directory is the source of truth. - Updated the WriteDeclarativeSchemas function to reflect the new behavior regarding PgDelta configuration. * fix(declarative): DSL change due to upgrade
* fix * test --------- Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
Add case 17 to the MajorVersion switch in config Load() so that major_version=17 resolves to the correct Docker image (supabase/postgres:17.6.1.106). Without this fix, db dump fails with 'server version mismatch' against remote PG17 databases because the Image field is never set for version 17. The Validate() function already accepts case 15, 17 as valid, but Load() never mapped version 17 to an image. Fixes supabase#5007 Signed-off-by: Nanook Claw <nanook@agentmail.to>
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.
Summary
Add
case 17to theMajorVersionswitch inconfig.Load()so thatmajor_version = 17resolves to the correct Docker image (supabase/postgres:17.6.1.106).Problem
supabase db dumpfails with "server version mismatch" when the remote database is PostgreSQL 17. The CLI's Docker container uses pg_dump 15.6, which refuses to connect to a PG 17.6 server.Root cause:
Load()only handlescase 13,case 14,case 15— there is nocase 17. TheImagefield is taggedtoml:"-"so users cannot override it viaconfig.toml. TheValidate()function already acceptscase 15, 17:as valid, somajor_version = 17is accepted — it just never assigns the correct Docker image.Changes
pkg/config/constants.go: Addpg17 = "supabase/postgres:17.6.1.106"constant (matches the version in the embedded Dockerfile template).pkg/config/config.go: Addcase 17: c.Db.Image = pg17to theMajorVersionswitch inLoad().Testing
go build ./...passesgo test -short ./...passes (only pre-existing keyring test failure unrelated to this change)Fixes #5007