Skip to content

Instantly share code, notes, and snippets.

@bryaneaton
Created July 6, 2021 18:08
Show Gist options
  • Save bryaneaton/ae7ac8ee7b015ded309c19b872ec9a95 to your computer and use it in GitHub Desktop.
Save bryaneaton/ae7ac8ee7b015ded309c19b872ec9a95 to your computer and use it in GitHub Desktop.
#!/bin/bash
export PGPASSWORD='SparklyBannana86' && psql -h gistnebula -p 5501 -d wstamp_staging -U worker -c "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