The connection pool (PostgreSQL)
Every connection to a PostgreSQL database goes through a connection pool (PgBouncer). Your apps can open many more connections than the plan allows; the pool keeps a set number of connections open to the database and shares them between your apps. MySQL has no pool.
Settings
Section titled “Settings”Open your database and go to the Connect tab, Connection pool:
- Pool mode
- Transaction (recommended): a connection is lent for one transaction at a time. Fits most apps.
- Session: each app connection keeps its own database connection until it disconnects. Works with every feature, but only as many apps can connect as the pool size allows.
- Statement: a connection is lent for one statement at a time. Transactions with several statements are refused.
- Pool size: how many connections the pool keeps open to the database, from 1 to your plan’s limit.
Save the change. The number of database connections each plan allows is on Plans and prices.
If you see “too many connections”, see Connection errors.
