Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rhettc
Created April 16, 2014 23:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhettc/10942523 to your computer and use it in GitHub Desktop.
Save rhettc/10942523 to your computer and use it in GitHub Desktop.
Show open connections to databases in a brief format conducive to CLI usage
SELECT procpid as pid,
usename as user,
datname as db,
application_name as app, waiting as wait, current_query as query
FROM pg_stat_activity
WHERE datname <> 'postgres';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment