Question

How to connect to PgBouncer in 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 DATABASE_URL with ${bragfy-pg-cluster.DATABASE_URL} 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

Subscribe
Share

Same problem here. I have a managed database with a pool, but I can’t connect to the pool through my App. It works fine on my local or on a droplet, but not through the App. Did you ever manage to resolve this?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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.

Same situation here, i can use the PostgreSQL database directly but not through the pool.

More precisely:

  • connection through pool from local is working fine,
  • connection from the docker running in App Platform is reaching time out.