Created
March 10, 2019 01:16
-
-
Save bfolkens/4c9978b537f3740419895029283fc485 to your computer and use it in GitHub Desktop.
Postgres - Show active processes
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
SELECT datname, pid, state, query, age(clock_timestamp(), query_start) AS age | |
FROM pg_stat_activity | |
WHERE state <> 'idle' | |
AND query NOT LIKE '% FROM pg_stat_activity %' | |
ORDER BY age; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment