How it works...

Connecting to the pgbouncer database name on port 6432 connects us to PgBouncer using a simulated database that doesn't actually exist. This name tells PgBouncer that we want the administration console. If we configured PgBouncer according to the Configure PgBouncer safely recipe, the postgres user is the only database user allowed to use the console.

By sending SHOW POOLS as a query, PgBouncer responds with a row for every PostgreSQL database to which it is acting as a proxy. Each column is a summary for various client and server metrics, mainly related to activity or status. Here is a detailed summary of the columns:

  • cl_active: This column shows the number of clients that are currently assigned to a server connection. This ...

Get PostgreSQL 12 High Availability Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.