Skip to content

Instantly share code, notes, and snippets.

@JoshuaGross
Created September 30, 2016 22:12
Show Gist options
  • Save JoshuaGross/c94fde7aac520733328adcdb610b3f67 to your computer and use it in GitHub Desktop.
Save JoshuaGross/c94fde7aac520733328adcdb610b3f67 to your computer and use it in GitHub Desktop.
PG running queries with age in seconds
# 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