Last active
August 29, 2015 14:27
-
-
Save imaginator/a2a71e4ec58b40f5f922 to your computer and use it in GitHub Desktop.
Postgres show who is connected and from where and how many connections
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u postgres psql -c "SELECT usesysid, usename, client_addr, count(usename) FROM pg_stat_activity group by usesysid, usename, client_addr;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment