Created
September 30, 2016 22:12
-
-
Save JoshuaGross/c94fde7aac520733328adcdb610b3f67 to your computer and use it in GitHub Desktop.
PG running queries with age in seconds
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
# Requires pg-datediff: https://gist.github.com/JoshuaGross/18b9bb1db8021efc88884cbd8dc8fddb | |
select datid, query, DateDiff('second', query_start::timestamp, NOW()::timestamp) from pg_stat_activity; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment