a year ago
I have a webserver and a database and I'm trying to connect to the db from the webserver using the PGPRIVATEHOST but it isn't working. Is there something else I need to do other than switch from PGHOST to PGPRIVATEHOST?
13 Replies
a year ago
you would also need to use the private port
Where would I find the private port? It's not listed as an env var on the database
a year ago
service settings

That's for public networking though. I don't see one under Private Networking?
a year ago
5432 is the private port
psycopg2.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known Still getting this :/
a year ago
please switch the runtime to v2

a year ago
also, please dont specify install commands in the build command field, it is poor practice

Oh yeah I had a buddy fix that for me and I forgot to remove it from the build command
Alrighty looks like one of those two things fixed it! Thanks for the help 😄
a year ago
no problem!