Repository navigation
Allow Postgres 18 in fly mpg create and default to 17 - #5445
Open
tripledoublev wants to merge 2 commits into
Open
tripledoublev wants to merge 2 commits into
tripledoublev wants to merge 2 commits into
Conversation
The dashboard offers Postgres 16, 17 and 18 for new Managed Postgres clusters and defaults to 17. fly mpg create rejected 18 and defaulted to 16. Accept 18, default to 17 for fly mpg create and fly launch, and keep the supported list in one place. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Cover the wiring, not only the validator: fly mpg create sends the default or the requested version and rejects others before any request, and fly launch sends the default. Build the supported-versions text from the list so help and errors cannot drift from it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Change Summary
What and Why:
The dashboard lets you create a Managed Postgres cluster on Postgres 16, 17 or 18, and defaults to 17.
fly mpg createrejected 18 and defaulted to 16:The check is client-side only. With it relaxed, the platform creates the cluster. This closes the gap between the CLI and the dashboard:
--pg-major-versionaccepts 16, 17 and 18.fly mpg createand for the clusterfly launchcreates.For reviewers: the default change is the part to weigh. Anyone running
fly mpg createorfly launchwithout--pg-major-versionnow gets 17 instead of 16. If you'd rather keep 16 as the CLI default, that is a one-line revert ofDefaultPGMajorVersion; accepting 18 stands on its own.Postgres 18 is now available to all organizations.
How:
internal/mpgutilnow holdsDefaultPGMajorVersion(an int), the list of supported versions,SupportedPGMajorVersionsTextandValidatePGMajorVersion.fly mpg createuses them for the flag default and the check, andfly launchuses the same default.mpg_test.gorebuilt the!= 16 && != 17condition inside the test, so they passed whatever the command did. They now callValidatePGMajorVersionand check thecreateflag's default and help text.Testing:
fly mpg createagainst mock APIs (no flag sends 17; 16, 17 and 18 are sent as given; 15, 19 and 0 are rejected before any request) and check the requestfly launchbuilds. Hard-coding 16 in launch, or ignoring the validation error in create, fails them.go build ./...,go vetandgo testpass forinternal/command/mpg/...,internal/mpgutil/...andinternal/command/launch/.... golangci-lint v2.15.0 reports 0 issues on those packages.fly mpg createwith no version flag created a cluster on 17.11;--pg-major-version 18created one on 18.6; 15 and 19 are rejected with the new message. Both clusters were destroyed afterwards.fly mpg connect -c,-fand-f -work, and apg_dump18 file restores.fly launchend to end (it shares the constant; unit tests pass), PostGIS on 18 (--enable-postgis-support), Windows or macOS.Found while testing superfly/docs#2647.
Note: the API itself still defaults to 16 when no version is sent, so flyctl keeps sending one.
Documentation
The generated
fly mpg createpage picks up the new help text after release. Hand-written pages that say "Postgres 16 and 17" need a follow-up in superfly/docs:postgres/extensions.mdxandpostgres/index.mdx.🤖 Generated with Claude Code