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;
Written by Brandon Hansen
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Postgres
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#