Database Runbooks
Blocking Transactions
Step 1 — List transactions that hold locks
SELECT a.datname,
l.relation::regclass,
l.transactionid,
l.mode,
l.granted,
a.usename,
a.query,
a.query_start,
age(now(), a.query_start) AS age,
a.pid
FROM pg_stat_activity a
JOIN pg_locks l ON l.pid = a.pid
ORDER BY a.query_start;Step 2 — Narrow down to transactions older than 1 hour
Step 3 — Terminate the offending backend
Step 4 — Verify recovery
Running Out of Disk Space
Step 1 — Identify the largest tables
Table
Why it grows
Step 2 — Reclaim space with VACUUM
Step 3 — Delete obsolete data (if needed)
Step 4 — Increase the volume size
Preventive Maintenance
Variable
Default
Description
Related Pages
Last updated
Was this helpful?
