Skip to content

Instantly share code, notes, and snippets.

@DBNess
Created November 23, 2010 13:44
Show Gist options
  • Save DBNess/711776 to your computer and use it in GitHub Desktop.
Save DBNess/711776 to your computer and use it in GitHub Desktop.
What's running on this PostgreSQL instance?
SELECT datname as database
, procpid as process_id
, current_query
, (current_timestamp - query_start) as duration
FROM pg_stat_activity
ORDER BY database, duration desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment