Postgres database connection ECONNREFUSED

Iam facing this error when running the code:
Error: connect ECONNREFUSED

I’m connecting on local postgres db and working fine, and created postgres db on render for the deployed v so it’s separate dbs, i tested the render db locally and it was connected and worked fine too so i can’t figure out what is really the problem ??

P.s It was connecting before and i added some more commits to find it not connecting now but it was so thta’s confusing !

When deployed on Render, your application and the Postgres database you provision run on two different systems, so (a.k.a. localhost) will fail to connect. You can get the connection strings from the ‘Info’ tab by clicking the database on the Render Dashboard.

See also PostgreSQL | Render · Cloud Hosting for Developers

– deleted –


– deleted –

You posted your database credentials to a public forum. We now need to rotate them in order to prevent anyone from being able to take advantage of that.

You should never share passwords, not even to support privately. No one needs your passwords but you. If they do, their service is probably terrible or you’re being scammed. Never ever ever share passwords.

Please contact us directly (via the Help link on the top of the Render Dashboard) so that we can arrange to do this.

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