Skip to content

fix(config): add PG17 image mapping for db dump#5083

Open
nanookclaw wants to merge 4 commits intosupabase:mainfrom
nanookclaw:fix/pg17-image-mapping
Open

fix(config): add PG17 image mapping for db dump#5083
nanookclaw wants to merge 4 commits intosupabase:mainfrom
nanookclaw:fix/pg17-image-mapping

Conversation

@nanookclaw
Copy link
Copy Markdown

Summary

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).

Problem

supabase db dump fails 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 handles case 13, case 14, case 15 — there is no case 17. The Image field is tagged toml:"-" so users cannot override it via config.toml. The Validate() function already accepts case 15, 17: as valid, so major_version = 17 is accepted — it just never assigns the correct Docker image.

Changes

  • pkg/config/constants.go: Add pg17 = "supabase/postgres:17.6.1.106" constant (matches the version in the embedded Dockerfile template).
  • pkg/config/config.go: Add case 17: c.Db.Image = pg17 to the MajorVersion switch in Load().

Testing

  • go build ./... passes
  • go test -short ./... passes (only pre-existing keyring test failure unrelated to this change)

Fixes #5007

avallete and others added 4 commits April 14, 2026 07:44
* 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>
@nanookclaw nanookclaw requested a review from a team as a code owner April 14, 2026 23:39
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.

4 participants