Interview Q&A / PostgreSQL
PostgreSQL interview questions
Indexes, EXPLAIN, transactions and isolation, JSONB and the Postgres specifics backend interviews probe.
Prefer rapid revision? Practise PostgreSQL short interview answers →
- How do you find which query is blocking another in PostgreSQL?
Look at pg_stat_activity for sessions with wait_event_type Lock, and use pg_blocking_pids(pid) to get the PIDs holding the lock. Then inspect those sessions and, if needed, cancel or terminate the blocker.
IntermediateQuick answer1 min read