© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
config_wizard

Cant connect to db using postgres details

When I try and connect to the database directly using psql, I get

psql: error: connection to server at "db.XXX.supabase.co" (35.176.XXX.XXX), port 5432 failed: Operation timed out
    Is the server running on that host and accepting TCP/IP connections?
psql: error: connection to server at "db.XXX.supabase.co" (35.176.XXX.XXX), port 5432 failed: Operation timed out
    Is the server running on that host and accepting TCP/IP connections?


When I try to do it programatically (Go code)
dsn := fmt.Sprintf("user=%s password=%s host=%s port=5432 dbname=postgres", USER, PASSWORD, HOST)
dsn := fmt.Sprintf("user=%s password=%s host=%s port=5432 dbname=postgres", USER, PASSWORD, HOST)


It hangs for ages, before I end up receiving:

 failed to initialize database, got error failed to connect to `host=db.XXX.supabase.co user=alex.walker database=postgres`: dial error (dial tcp [64:ff9b::XXX:XXX]:5432: connect: no route to host)
 failed to initialize database, got error failed to connect to `host=db.XXX.supabase.co user=alex.walker database=postgres`: dial error (dial tcp [64:ff9b::XXX:XXX]:5432: connect: no route to host)


Interestingly this looks like the cli is using IPV4 and the Go Postgres cli is using IPV6, both failing.

I have created the database about 20 minutes ago. I wondered if there is any firewalling going on or something I need to change?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

cant connect to db server
SupabaseSSupabase / help-and-questions
4y ago
cant connect to db (python tortoise-orm)
SupabaseSSupabase / help-and-questions
13mo ago
"failed to connect to postgres: failed to connect to" using supabase cli
SupabaseSSupabase / help-and-questions
5mo ago
Failed to connect to postgres
SupabaseSSupabase / help-and-questions
3w ago