PostgreSQL: Find slow, long-running, and Blocked Queries

If you run a PostgreSQL database, use pg_stat_activity to find and identify slow and blocked processes and queries, with the query text and responsible user quickly. pg_blocking_pids and pg_locks will give you everything you need to know about database locks.