Skip to content

Instantly share code, notes, and snippets.

@imaginator
Last active August 29, 2015 14:27
Show Gist options
  • Save imaginator/a2a71e4ec58b40f5f922 to your computer and use it in GitHub Desktop.
Save imaginator/a2a71e4ec58b40f5f922 to your computer and use it in GitHub Desktop.
Postgres show who is connected and from where and how many connections
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