Supabase Connection

Supabase projects are Postgres under the hood, but Supabase exposes three different endpoints for a given project, with subtly different behavior. The Supabase connection type in Mycorr is the PostgreSQL connection with a form that reads Supabase's connection string for you and steers you to the right endpoint.

If you just want the short version: use the Session Pooler endpoint on port 5432, with the postgres.<project-ref> username and your project database password. Read on for why.

What you need

  • A Supabase project (any plan, free tier works).
  • The database password for your project. This is the one you set during project creation — it's not your Supabase login password and it's not your anon / service-role key.
    • Forgot it? In the Supabase dashboard: Project Settings → Database → Reset database password.

You do not need to create a separate Postgres role for Mycorr — Supabase exposes the postgres superuser by default, and the pooler endpoints route through it. If you want stricter least-privilege, create a dedicated read-only role as described in the Postgres connection page.

The three Supabase endpoints

In the Supabase dashboard, the Connect button shows three connection strings:

EndpointPortWhat it isUse it for Mycorr?
Direct connection5432Talks straight to Postgres. IPv6-only on the free / Pro plan unless you have the IPv4 add-on.Only if you have the IPv4 add-on, or if your network has IPv6.
Session Pooler5432Supavisor in session mode — looks like a normal Postgres connection, IPv4-reachable.Yes — recommended.
Transaction Pooler6543Supavisor in transaction mode. One server connection is multiplexed across many clients per transaction.Works, but session mode is simpler.
  • IPv4 by default, so it works from Mycorr's network without any add-ons.
  • Behaves like a regular Postgres connection — no transaction-mode pitfalls.
  • Same TLS guarantees as the direct connection.

If you specifically want transaction-pooler semantics (e.g. because that's how the rest of your stack connects), the Transaction Pooler on port 6543 also works — Mycorr disables named prepared statements so the typical prepared statement "sqlx_s_1" already exists collision doesn't occur.

Setting it up

  1. In the Supabase dashboard, click Connect and copy the Session pooler connection string. It looks like:

    postgresql://postgres.abcdefghijklmnop:<password>@aws-0-eu-west-1.pooler.supabase.com:5432/postgres
    
  2. In Mycorr, open Connections → Add connection and pick Supabase.

  3. Paste the string into Paste from Supabase. Mycorr fills in the host, port, database and username, and the password if the string has one. Otherwise, enter your project's database password.

  4. Give the connection a Name and click Test & save.

The form warns you if the host is the IPv6-only direct host (db.<ref>.supabase.co) or doesn't look like Supabase at all.

The username must be postgres.<project-ref>, with the dot and the project ref: the pooler uses it to find your project. Plain postgres fails with Tenant or user not found.

Encryption

The Supabase form starts on Encrypt only: the connection is encrypted, but Supabase's server certificate is signed by Supabase's own CA, which isn't in the standard trust store.

To also verify the certificate, download your project's CA certificate from Supabase's database settings, switch to Encrypt & verify, and paste it under Advanced. See PostgreSQL → Encryption.

Permissions

Out of the box, Mycorr will connect as the postgres superuser through the pooler. That's fine for reading, but it's broader access than necessary. To follow least-privilege:

-- Run this in the Supabase SQL editor (Project → SQL Editor).
CREATE ROLE mycorr_reader WITH LOGIN PASSWORD '<strong-random-password>';
GRANT USAGE ON SCHEMA public TO mycorr_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO mycorr_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
  GRANT SELECT ON TABLES TO mycorr_reader;

Then use mycorr_reader.<project-ref> as the username in the pooler URL (the dot-suffix is still required for pooler routing).

If you use Supabase's Row-Level Security, remember that policies are evaluated against the connecting role — mycorr_reader will see exactly what your policies allow that role to see.

Importing data

Same as any Postgres connection, including SQL query imports and syncing. See PostgreSQL → Importing data.

Troubleshooting

ErrorLikely causeFix
connection refused / failed to lookup address on port 5432You used the direct connection string and your network has no IPv6Switch to the Session pooler string (still port 5432)
password authentication failedWrong password — most often, you used your Supabase login password instead of the database passwordProject Settings → Database → Reset database password, copy the new one
Tenant or user not foundUsername is missing the .<project-ref> suffix on a pooler endpointUse postgres.<project-ref> (or <your-role>.<project-ref>)
SSL error: certificate verify failedEncrypt & verify without Supabase's CAPaste your project's CA under Advanced, or switch back to Encrypt only
prepared statement "..." already existsYou're on the transaction pooler (port 6543) and Mycorr's auto-disable of named statements didn't take effectSwitch to the session pooler (port 5432), or contact support

Revoking

Two ways:

  • In Mycorr: on the Connections page, open the connection and delete it. Its tables keep their data but stop syncing.
  • In Supabase: rotate the database password (Project Settings → Database → Reset database password) or drop the dedicated role. The next sync fails.