Question

How to connect to PgBouncer in App Platform

Posted August 25, 2021 125 views
DigitalOcean Managed PostgreSQL DatabaseDigitalOcean App Platform

Hi,

I am trying to setup an app with a managed PG database which has a connection pool, but it always times out. I also noticed that if I detach the DB from my app, even though the DB is publicly exposed, it won’t connect.

The only way I could connect my app to the DB is going through the interface and attaching it, but there is no option to select the pool, only the cluster itself. If you select the cluster, it sets the DATABASEURL with `${bragfy-pg-cluster.DATABASEURL}` which is the same URI as the one in public PG database.

Is this supported? If so, how can I connect my app to the pool?

Regards,
Vitor

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Did you solve this problem? I’m facing the same problem.

Works if I run the App on my local machine and use the connection pool to connection to the database, but fails if the same is done on the App Platform itself.