supabase start uses PostgreSQL 17 instead of matching remote version (15.8), causing db diff incompatibility
Bug report
- [ X] I confirm this is a bug with Supabase, not with my own application.
- [X ] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When I run supabase start, the CLI automatically downloads and starts a container with PostgreSQL version 17. However, my linked remote Supabase project is using PostgreSQL version 15.8.
As a result, running commands like supabase db diff throws a version incompatibility error. The diff cannot be completed due to the version mismatch between the local container and the remote database.
To Reproduce
Steps to reproduce the behavior:
-
Link a Supabase project that uses PostgreSQL 15.8 using supabase link
-
Run supabase start – this downloads PostgreSQL 17
-
Run supabase db diff
-
Observe version mismatch error
Expected behavior
The Supabase CLI should match the local container's PostgreSQL version to the linked project's version (15.8 in my case) or allow us to specify the version to avoid incompatibility issues during diff operations.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [ Windows]
- Version of Node.js: [e.g. 20.1]
Additional context
This version mismatch breaks the supabase db diff command. It would be helpful to either:
Allow CLI users to specify the local Postgres version for containers
Automatically detect and match the linked remote project’s Postgres version
Yeah my workflow also started failing recently because of generated schema inconsistency.
I asked here #3758 how we can prepare us for major upgrades before the pipelines starts breaking.
Thanks for reporting this issue. Currently we don't link the major version automatically but it's definitely something we can fix.
Meanwhile the workaround is to set major version to 15 in supabase/config.toml file.
[db]
major_version = 15
Thanks for reporting this issue. Currently we don't link the major version automatically but it's definitely something we can fix.
Meanwhile the workaround is to set major version to 15 in
supabase/config.tomlfile.[db] major_version = 15
Didn't work for this command supabase db dump, seeing pg17-specific syntax like:
\restrict 3zp28dgGK1J3g8Rit0AmmtSxddzeFdHmVeZ1XjZbCdwfpH6tkTKcq4HIhudeJdk
This is what I ended up doing in Github actions to pin to a pg15-specific version of the CLI:
- uses: supabase/setup-cli@v1
with:
version: 2.20.12
You can also try v2.41.2 which solves the restrict issue.