Last active
November 29, 2018 07:14
-
-
Save damon140/a38876a50a8626721f40b0e13207163b to your computer and use it in GitHub Desktop.
Helpful PostgreSQL Queries
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
-- show running queries, oldest first (postgres 10.5) | |
SELECT pid, age(clock_timestamp(), query_start), usename, state, query | |
FROM pg_stat_activity | |
WHERE state != 'idle' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY age desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment