Skip to content

Instantly share code, notes, and snippets.

@danp
Created April 16, 2014 15:42
Show Gist options
  • Save danp/10896220 to your computer and use it in GitHub Desktop.
Save danp/10896220 to your computer and use it in GitHub Desktop.
whatsup.sql
select
client_addr || ':' || client_port as client,
substr(query, 0, 100) as query,
waiting,
state,
now() - xact_start as xact_for
from
pg_stat_activity
where
state <> 'idle'
order by xact_for desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment