-
-
Save ValentinTrinque/0173453164c9bdd970c4547f28fa832b to your computer and use it in GitHub Desktop.
Show PostgreSQL current (running) process list;
This file contains hidden or 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 user, pid, client_addr, waiting, query, query_start, NOW() - query_start AS elapsed | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' | |
| -- AND EXTRACT(EPOCH FROM (NOW() - query_start)) > 1 | |
| ORDER BY elapsed DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment