- The deadline for the migration has been updated to 26th January 2024.
- You can now purchase a IPv4 address from the add-ons page here if you want to keep using your IPv4 address. More info here.
With IPv4 addresses becoming increasingly scarce and cloud providers starting to charge for it, we won’t be assigning IPv4 addresses to Supabase projects from January 15th 2024. db.projectref.supabase.co
will start resolving to a IPv6 address instead. If you plan on connecting to your database directly, you must ensure that your network can communicate over IPv6. Supavisor will continue to return IPv4 addresses, so you can update your applications to connect to Supavisor instead.
There will be a few minutes of downtime during this migration.
We recently announced Supavisor, our new connection pooler. Supavisor is a direct replacement for PgBouncer. Using our own pooler is going to let us do things like load balancing queries across read replicas, query results caching, and a lot more.
Supavisor is now enabled for all projects created on or after Wednesday September 27th 2023. All existing projects will have Supavisor enabled by October 15th 2023.
Supavisor does not currently support Network Restrictions. Network restrictions support will be enabled from 24th January 2024. If you are blocked on the migration because of this, please reach out to support and we will extend the deadline for your project.
You don’t need to change anything in your application, except for the URL. The pooler connection string is available in the database settings in your dashboard.
For example, if you use PgBouncer to connect:
_10import { drizzle } from 'drizzle-orm/postgres-js'
_10import postgres from 'postgres'
_10import { users } from './schema'
_10// probably an env var
_10const connectionString = 'postgres://user:[YOUR-PASSWORD]@db.[YOUR-PROJECT-ID].supabase.co:6543/postgres'
_10const client = postgres(connectionString)
_10const db = drizzle(client);
_10const allUsers = await db.select().from(users);
you just need to update the connection string to:
_10import { drizzle } from 'drizzle-orm/postgres-js'
_10import postgres from 'postgres'
_10import { users } from './schema'
_10// probably an env var, get the exact connection string from the database settings page
_10const connectionString = 'postgres://[db-user]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?options=reference%3D[project-ref]'
_10const client = postgres(connectionString)
_10const db = drizzle(client);
_10const allUsers = await db.select().from(users);
PgBouncer will be available to use along side Supavisor until January 31st 2024.
The full timeline is:
- 27 September 2023: Supavisor is available for all new projects.
- 15 October 2023: Supavisor will be available for all projects, including existing projects. We will notify you via email when it is enabled for your project. PgBouncer is officially deprecated after this date.
15th January 2024 26th January 2024: You will need to start using Supavisor before then.
- 29th January 2024: Your Supabase database domain (
db.projectref.supabase.co
) will start resolving to IPv6 addresses. PgBouncer will be removed. Projects will be migrated over starting this day. No changes are required if your network supports communicating via IPv6. If it doesn't, update your applications to use Supavisor which will continue to return IPv4 addresses.
You will receive deprecation notices throughout November, December, and January.
For projects which only use the database REST API provided by PostgREST (via supabase-js
) there is no action needed.
projectref.supabase.co
will continue to return IPv4 addresses. Only the database domain db.projectref.supabase.co
will return a IPv6 address.
Check if you are able to request your IPv6 address via curl -6 https://ifconfig.co/ip
If you have issues with Supavisor please contact support!
You can purchase the IPv4 addon for 4$/project in the project add-on page here. PGBouncer will still be removed for users with the IPv4 add-on.
While we are providing the ability to use PgBouncer or Supavisor during this migration you cannot use both at the same time. With the default configuration using both will exhaust your database connections because they both will try and spin up a connection pool.
The solution is to temporarily increase your databases connection limit with a custom Postgres config to accommodate both connection pools.
_10supabase --experimental --project-ref <project-ref> postgres-config update --config max_connections=120
If the URL you use to connect to your Supabase Database looks like this, you're using the API, and no changes are necessary:
https://[YOUR-PROJECT-ID].supabase.co
If the URL you use to connect looks like either of these options, you're already using Supavisor, and no further changes are necessary:
postgres://[db-user]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?options=reference%3D[project-ref]
or postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]
If the URL you use to connect looks like this, you are using pgBouncer, and you need to upgrade (notice port 6543):
postgresql://[db-user]:[db-password]@db.[project-ref]supabase.co:6543/[db-name]
If the URL you use to connect looks like this, you are connecting directly, and will either need to be able to connect via IPv6, OR you will need to update to the Supavisor URL:
postgresql://[db-user]:[db-password]@db.[project-ref].supabase.co:5432/[db-name]
In the database settings page, the label when connection pooling is disabled, reads Will resolve to IPv6
if your project has not been migrated. If your project has been migrated to IPv6, it reads `Resolves to IPv6'.
The error thrown will depend on how you are connecting to the database. Here are some examples of error messages you might see
(dial tcp [2001:db8:3333:4444:5555:6666:7777:8888]:5432: connect: no route to host)
connect to db.example.supabase.co (2001:db8:3333:4444:5555:6666:7777:8888) port 5432 (tcp) failed: Network is unreachable
could not translate host name "db.example.supabase.co" to address: nodename nor servname provided, or not known
ENETUNREACH 2001:db8:3333:4444:5555:6666:7777:8888
Error: P1001: Can't reach database server at db.example.supabase.co:5432
- (2001:db8:3333:4444:5555:6666:7777:8888), port 5432 failed: could not create socket: Address family not supported by protocol
Note that these errors may manifest in cases other than your client network not supporting IPv6, but if you run into these errors after your project was migrated, it is likely that it is due to IPv6 support.
The database settings page does not show PgBouncer connection settings. If you see a warning label called PgBouncer pending removal
, it means that PgBouncer has not been removed from your project. If you see no such label, PgBouncer has already been removed from your project.
Prepared statements are supported with session
mode. You can change your pool mode to session
in your dashboard.
You can also use a session
mode pool with your Supavisor pooler url and port 5432 (vs 6543). If you need to run something using prepared statements while your production application uses transaction
mode you can use this port to do that.
Initial support for prepared statements with transaction
mode landed but some bugs were found and should be fixed shortly.
If you are using Prisma, please check out our updated Prisma Guide for instructions on how to configure your connections for both querying and migrations.
The environment variables POSTGRES_URL
and POSTGRES_PRISMA_URL
point to Supavisor and POSTGRES_URL_NON_POOLING
points to Supavisor in session mode. Redeploy your Vercel application to pick up the latest environment variables. This is required since Vercel does not support IPv6.
Enable the IPv4 add-on. Set the direct connection url as a environment variable not managed by the Supabase integration. You can now use the environment variable in your application.
If you are using a version before 1.136.3, please upgrade to a later version of the CLI and run supabase link
. If you haven’t run supabase link
since 1st January 2024, please run it again after upgrading. This will enable the CLI to communicate to the database from IPv4 only environments because the communication happens via Supavisor. This change is required if you are using from the CLI from an environment without IPv6 support, like Github actions or possibly from your home network.
You will need to add Pooling=false
to your Supavisor connection string.
We are in the midst of transitioning all projects to IPv6. As part of this process, If your project is still being assigned an IPv4 address then pg_upgrade will be temporarily disabled for your project until the transition is completed.