Postgres active queries

From UVOO Tech Wiki
Jump to navigation Jump to search
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'