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?


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)

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)


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?
Was this page helpful?