Help: Cannot connect n8n Postgres Account to my Supabase PostgreSQL database

I’m having trouble connecting n8n to my Supabase PostgreSQL database. I’ve tried using the connection string and manual configuration with these details:

I’ve also tried different connection methods but nothing works. Has anyone successfully connected n8n to Supabase?
For a direct connection it also mentioned:
postgresql://postgres:[YOUR-PASSWORD]@db.myprojectid.supabase.co:5432/postgres

So basically I want to create a Postgres Account so that I can access my supabase database via agents where I cant use my supabase credentials as login.

Information on your n8n setup

  • n8n version: 1.81.4
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): gcloud
  • Operating system: WIndows 10

@Kiremit I suggest you try to connect to pgsql somewhere else like terminal or python. Make sure you can connect to the pgsql successful first.

@Kiremit, you’re using the incorrect credentials. Supabase provides two sets of credentials: one for their API and another for PostgreSQL. The credentials you’re currently using are for their API, not PostgreSQL.

You can find the PostgreSQL credentials by clicking on Connect, then scrolling down to Transaction Pooler. These are the credentials for your PostgreSQL database, and the password is the same as the one from the previous set of credentials.

1 Like

I tried that all along before. But no ability to enter the pool_mode. The password I used the same as when setting up the project. entering it without the brackets

@Kiremit You don’t need to enter the Pool Mode, fill in only the fields that n8n needs for PostgressQL.

Doesnt work. Maybe the password shouldnt contain special characters I dont know

@Kiremit, the password is supposed to contain special character due to security reasons. But are you sure that all credentials are correctly filled in?

Supabase doesn’t make use of the default PostgressQL port, so make sure that one is changed to the one you were given.

1 Like

I mean besides the password there is not really any credentials. The Project ID sure but thats part of the link. I only wonder why the password is part of the link ajnd then has to be entered seperately via N8N again

@Kiremit, the password is included in the link because of something called Connection URI’s. However, you’ll still need to enter each detail separately into n8n. The host goes in the host field, the database in the database field, the user in the user field, and the password remains the same. The port should go in the port field.

Please use the credentials I’ve highlighted in blue:

1 Like

You’re my savior! Thank you so much!

Thanks a lot man! working fine!

If anyone getting an error please use this connection.

" Transaction pooler

Shared Pooler

Ideal for stateless applications like serverless functions where each interaction with Postgres is brief and isolated."

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.