PostgreSQL Troubleshooting Toolkit
Diagnose slow queries and EXPLAIN plans, locks and deadlocks, bloat and vacuum, replication lag, and connection exhaustion with prompts and runbooks.
Top PostgreSQL errors
Start with the most common production issues and troubleshooting paths.
canceling statement due to conflict with recovery
Fix PostgreSQL 'canceling statement due to conflict with recovery' on hot standbys: tune max_standby_delay, hot_standby_feedbac…
canceling statement due to lock timeout
Fix PostgreSQL 'canceling statement due to lock timeout': diagnose blocking sessions, long transactions, and tune lock_timeout…
could not serialize access due to concurrent update
Fix PostgreSQL 'could not serialize access due to concurrent update': understand REPEATABLE READ/SERIALIZABLE conflicts and add…
duplicate key value violates unique constraint
Fix PostgreSQL 'duplicate key value violates unique constraint': diagnose race conditions, out-of-sync sequences, and resolve w…
invalid page in block
Fix PostgreSQL 'invalid page in block': diagnose page-level corruption, identify the affected relation, and recover with checks…
out of shared memory
Fix PostgreSQL 'out of shared memory': diagnose max_locks_per_transaction exhaustion from many partitions and tables, and tune…
permission denied for table
Fix PostgreSQL 'permission denied for table': diagnose missing GRANTs, schema USAGE, role membership, and default privileges fo…
SSL connection has been closed unexpectedly
Fix PostgreSQL 'SSL connection has been closed unexpectedly': diagnose idle timeouts, server crashes, OOM kills, and network re…
Best PostgreSQL prompts
Use these prompts to turn symptoms, logs, and config into a structured troubleshooting plan.
Postgres Checkpoint & WAL Throughput Tuning
Smooth out checkpoint-driven I/O spikes and write stalls by tuning checkpoint, WAL, and full-page-write settings for the workload — without risking longer crash recovery than the RTO allows.
Postgres Disk-Full & pg_wal Growth Emergency Triage
Work through a Postgres disk-full or runaway pg_wal/pg_xlog incident under pressure — find what is consuming space, free it safely, and recover the instance without deleting WAL Postgres still needs.
Postgres Integer Primary-Key / Sequence Exhaustion Remediation
Plan the migration of an int4 (serial) primary key approaching its 2.1-billion ceiling to bigint, with a low-downtime backfill and a tested cutover before INSERTs start failing.
Postgres on Kubernetes Operator Troubleshooting
Diagnose a Postgres cluster managed by a Kubernetes operator (CloudNativePG, Crunchy PGO, Zalando) — stuck failovers, pods CrashLooping, PVC/storage issues, and split-brain risk — using operator status and pod logs.
Free PostgreSQL tool
Validate, troubleshoot, or analyze your configuration before production changes.
AI Incident Response Assistant
Paste a slow query, plan, or lock, get a structured investigation.
Start triagePostgreSQL runbook
Use a repeatable checklist for production troubleshooting.
A first-response checklist for a struggling Postgres instance.
- 1 Check active queries and locks (pg_stat_activity, pg_locks)
- 2 Review slow queries and their EXPLAIN (ANALYZE) plans
- 3 Inspect bloat and autovacuum activity
- 4 Check replication lag and WAL status
- 5 Review connection limits and pooling (max_connections, PgBouncer)