This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- All commands assume 9.2 + | |
-- show running queries | |
SELECT pid, age(query_start, clock_timestamp()), state, waiting, usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' | |
AND query NOT ILIKE '%pg_stat_activity%' | |
AND state != 'idle' | |
ORDER BY query_start desc; |