Skip to content

Instantly share code, notes, and snippets.

@mindscratch
Created September 11, 2017 00:47
Show Gist options
  • Select an option

  • Save mindscratch/aaa2b1434ef0603f3df999a7d2d51ed6 to your computer and use it in GitHub Desktop.

Select an option

Save mindscratch/aaa2b1434ef0603f3df999a7d2d51ed6 to your computer and use it in GitHub Desktop.
postgres connections
SELECT
pid, application_name, query, state, state_change
FROM pg_stat_activity
WHERE usename = CURRENT_USER
ORDER BY state_change desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment