Skip to content

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

Closed
nanookclaw wants to merge 2 commits into
supabase:mainfrom
nanookclaw:fix/pg17-image-mapping
Closed

fix(config): add PG17 image mapping for db dump#5083
nanookclaw wants to merge 2 commits into
supabase: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

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

jgoux commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Hello, thanks for your contributions.
Since this PR was opened we ported the command from Go to TypeScript and the bug should be fixed now. 👍

@jgoux jgoux closed this Jun 22, 2026
pull Bot pushed a commit to pjpjq/cli that referenced this pull request Jun 22, 2026
## Summary

Make the TS legacy Postgres image resolver read the default image from
the same Dockerfile manifest used by the Go config image table.

This removes the duplicated PG17 tag from the TS port, keeps `db dump`
aligned with Dependabot updates to
`apps/cli-go/pkg/config/templates/Dockerfile`, and preserves the
existing service image parser export for callers.

## Context

PR supabase#5083 highlighted that PG image selection can drift when the default
Postgres image is copied into multiple places. The active TS `db dump`
path already selected a PG17 image, but its hardcoded tag had drifted
from the Dockerfile manifest.
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.

2 participants