a year ago
I recently set up a PostgreSQL database and configured a custom domain name for it.
I successfully added the CNAME to my Cloudflare settings, but I'm experiencing issues connecting to the database. While attempting to connect through my application, I'm receiving CONNECT_TIMEOUT errors.
Here is an example of how I am trying to connect to the database:
```
import postgres from 'postgres';
const sql = postgres({
host: 'database.ethelmc.com',
database: 'railway',
username: 'postgres',
password: 'MY_PASSWORD',
ssl: 'require',
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 20000,
});
export default sql;
```
Could you please investigate my project and provide guidance on how to resolve this issue? Your assistance would be greatly appreciated!
here are some screenshots:

2 Replies
a year ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 12 months ago
a year ago

a year ago
You added a domain when you should have added a TCP Proxy.
Remove the domain, and add a TCP Proxy.
After that, redeploy the database.
Status changed to Solved brody • 12 months ago
