On an admin dashboard page of a PHP web application, I would like to display details about the database connection. Depending on the local setup, the connection may be direct, or it may be brokered by PgBouncer. Is it possible to detect exactly what I'm connecting to? This information could be useful for debugging.
Checking the default ports (6432 vs 5432) is possible but obviously unreliable. Does PgBouncer inject anything into the connection that would help differentiate it from a direct connection?