Last Updated: February 25, 2016
·
336
· ready4god2513

Find Connections in PostgreSQL

Understanding database connection pools is tough stuff. Most devs (myself included) have a tendency to gloss right over the details in favor of writing business application code. But having an understanding of how it works can save you from massive headaches and frustration in the long-run. Take the time to understand the details, you will be glad you did. Anyways, moving on, to find the number of active connections on your postgres database, run the following-

select count(*) from pg_stat_activity where pid <> pg_backend_pid() and usename = current_user;