Skip to content

Instantly share code, notes, and snippets.

@umutcoskun
Created September 1, 2022 11:14
Show Gist options
  • Save umutcoskun/bbf564b1f4151a523ac1b63bc5623dd9 to your computer and use it in GitHub Desktop.
Save umutcoskun/bbf564b1f4151a523ac1b63bc5623dd9 to your computer and use it in GitHub Desktop.
sudo -u postgres psql
-- show running queries
SELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment