We’ve published a new guide to make it easier for folks running Phoenix with Fly.io’s Managed Postgres (MPG). It’s focused on the key changes developers need to make when connecting Phoenix to MPG, helping you skip the usual gotchas and get to a working production setup faster.
We’ve also updated the MPG docs navigation to include a dedicated “Guides and Examples” section, making it easier to find framework-specific content like this.
If you’ve worked with Phoenix and Ecto, the basics won’t surprise you. These Managed Postgres adjustments are new, and they’re easy to miss if you’re not looking for them:
-
Connection pooling: MPG uses PgBouncer. Phoenix/Ecto requires Transaction mode, along with
prepare: :unnamed. -
Migrations: PgBouncer’s transaction mode can’t handle advisory locks, so migrations need to run against the direct database URL.
-
Oban jobs: LISTEN/NOTIFY isn’t supported behind PgBouncer. The guide walks through using alternative notifiers (PG, Phoenix PubSub) or a direct connection if you need Postgres LISTEN/NOTIFY.
-
Troubleshooting: A checklist of common errors and fixes, so you can quickly spot misconfigurations.
Check it out here: Phoenix with Managed Postgres
Whether you’re setting up a new Phoenix project or updating an existing app, this guide should save you time and help you avoid the sharp edges we see most often.