Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save unavailabl3/62471575076bbaa2b3433f9bb03cf328 to your computer and use it in GitHub Desktop.
Save unavailabl3/62471575076bbaa2b3433f9bb03cf328 to your computer and use it in GitHub Desktop.
SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment