Having trouble connecting to postgresql

Hi i just recently deployed a postgresql instance and made a database and I am trying to connect through node.js.I am getting the error: getaddrinfo ENOTFOUND dpg-cijt0u6nqql0l1u2s930-a when using this code:

const { Pool } = require(‘pg’);
const con = new Pool({
user: ‘username’,
password: ‘password’,
database: ‘database’,
host: ‘dpg-cijt0u6nqql0l1u2s930-a’,
port: 5432
});

Any help would be appreciated thanks.

Hi Jack,

Are you still running into this issue? I see that your most recent deployment was successful. After confirming that your database and service are hosted on the same region, if you’re still running into this issue, you would probably want to double check the credentials as well as the format of the database configuration within your app.

Best,

Yes I am still running into this issue. I am able to deploy the database but I can’t connect to it through code. Is the code I have provided the proper way to connect a render postgresql database?

Hi Jack,

Provided you have also populated the username, password, database, it seems like that’s the format that your application expects.

We can also take a close look if you’re able to share a link to the logs or deploy where you’re seeing this error. As this is about a specific service we’d request that you login to our dashboard and contact us via the ‘Help’ link at the top of our dashboard and make sure you pick the service that this question relates to from your account.

As this is a public forum it’s probably best not to share that directly here.

Best,

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