mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
Closes DOCS-1519 ## Problem DOCS-1519 asks the docs team to do two things: unify the connection recommendations, and remove PgBouncer deprecation notices. PgBouncer isn't deprecated. It runs the dedicated pooler. **Deprecation notices:** no page in `apps/docs` says PgBouncer is deprecated. The last notice was in a 2021 blog post, and #52249 removed it. Two notices remain outside the docs: - **Studio:** the support form's IPv4 alert links to a "PGBouncer and IPv4 Deprecation" discussion. - **Blog:** a September 2023 update says PgBouncer is deprecated as of January 2024. **Recommendations:** Supabase runs two server-side poolers. The shared pooler runs on Supavisor and is on every plan. The dedicated pooler runs on PgBouncer and is on the Pro Plan and above. The docs name the two poolers in many ways, and many pages leave out the dedicated pooler. Some pages contradict the recommendations table in [Connect to your database](https://supabase.com/docs/guides/database/connecting-to-postgres#choose-a-connection-method): - **Prepared statements:** `connecting-to-postgres` says transaction mode doesn't support them. That is true for the shared pooler only. The dedicated pooler supports them on PgBouncer 1.21 and later. - **Migrations:** the restore pages, the quickstart partial, and the RedwoodJS quickstart send migrations and `pg_dump` through session mode. The table says to use the direct connection. - **Dedicated pooler:** `pooling-and-limits` says to use it on any IPv6 network. The table keeps it for high-load apps. ## Solution - **Names:** pages say _shared pooler_ and _dedicated pooler_, in lowercase. Each page names Supavisor or PgBouncer once, after the pooler name. _Session pooler_ and _Transaction pooler_ stay only where a page quotes the Connect dialog. - **Plans:** pooler and connection pages say _Pro Plan and above_ instead of _paid plans_. - **Recommendations:** every page above now matches the table. The shared pooler in session mode is the fallback for IPv4-only networks. - **Dedicated pooler coverage:** Managing connections and the IPv4 add-on page now cover the dedicated pooler. - **Word list:** `WORD_LIST.md` gets `dedicated pooler`, `shared pooler`, and `paid plan` entries. **Also fixed:** - The direct connection examples in both restore pages had the wrong username and `.supabase.com`. - The Managing connections heading changed. It keeps the `#configuring-supavisors-pool-size` anchor, because Studio links to it. **Not changed:** billing and usage pages that say _paid plans_, self-hosting pages, `apps/www`, and Studio. The Postgres and Render migration guides moved to `apps/kb` on `master` while this PR was open, so their edits are no longer in this diff. **Troubleshooting articles:** production redirects `/docs/guides/troubleshooting/` to `/kb/troubleshooting/`, which builds from the troubleshooting repo. The troubleshooting edits move there under DOCS-1521. **Size:** 25 files, 115 lines added and 97 removed. ## Preview links | Page | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | /connecting-to-postgres | [Live](https://supabase.com/docs/guides/database/connecting-to-postgres) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres) | A high-load application on the Pro Plan and above | | /pooling-and-limits | [Live](https://supabase.com/docs/guides/database/connecting-to-postgres/pooling-and-limits) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres/pooling-and-limits) | Use it for high-load applications | | /connection-management | [Live](https://supabase.com/docs/guides/database/connection-management) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connection-management) | The pool size applies to both the shared pooler | | /ipv4-address | [Live](https://supabase.com/docs/guides/platform/ipv4-address) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/ipv4-address) | When using the dedicated pooler in an IPv6-incompatible network | | /backup-restore | [Live](https://supabase.com/docs/guides/platform/migrating-within-supabase/backup-restore) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/migrating-within-supabase/backup-restore) | Use the direct connection string. If your network | | /dashboard-restore | [Live](https://supabase.com/docs/guides/platform/migrating-within-supabase/dashboard-restore) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/migrating-within-supabase/dashboard-restore) | Use the direct connection string. If your ISP | | /redwoodjs | [Live](https://supabase.com/docs/guides/getting-started/quickstarts/redwoodjs) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/getting-started/quickstarts/redwoodjs) | This quickstart uses two connection strings | ## Review instructions 1. Open [Connect to your database](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres). The table and the **Dedicated pooler** section say _Pro Plan and above_. 2. Open [Connection pooling and limits](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres/pooling-and-limits). It recommends the dedicated pooler for high-load apps only. 3. Open [Managing connections](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connection-management). The pool size section covers both the shared pooler and the dedicated pooler. 4. Open [Backup and restore](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/migrating-within-supabase/backup-restore). Step 3 says to use the direct connection string. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
14 lines
1.6 KiB
Plaintext
14 lines
1.6 KiB
Plaintext
1. Navigate to your project dashboard and click on [Connect](/dashboard/project/_?showConnect=true&connectTab=direct&method=session).
|
|
|
|
<Admonition type="note">
|
|
|
|
These steps use the Session pooler (port `5432`), which works from IPv4-only networks. Use the direct connection string instead if you're in an [IPv6 environment](/kb/troubleshooting/supabase--your-network-ipv4-and-ipv6-compatibility-cHe3BP) or have the [IPv4 add-on](/docs/guides/platform/ipv4-address). For serverless or edge functions, use the Transaction pooler (port `6543`) and turn off prepared statements, which it doesn't support. See [Which connection method do you use?](/docs/guides/database/connecting-to-postgres#choose-a-connection-method).
|
|
|
|
</Admonition>
|
|
|
|
1. Look for the **Session pooler** connection string and copy it. Replace the password placeholder with your saved database password, and [percent-encode](https://en.wikipedia.org/wiki/Percent-encoding) any reserved characters it contains, such as `&`, `#`, `?`, or a space. If you don't have your database password, you can reset it in your [Database Settings](/dashboard/project/_/database/settings).
|
|
|
|
1. Set `sslmode=require` either on the connection string itself or as an explicit config option if your framework sets it separately. Most drivers default to `prefer`, which falls back to sending your data in plaintext if the encrypted attempt fails. You can also [enforce SSL](/docs/guides/platform/ssl-enforcement) on the database side.
|
|
|
|
The connection strings below show the format only. Take the host, port, and username from the string you copied rather than typing the bracketed placeholders literally.
|