PostgreSQL 08006: server closed the connection unexpectedly

Backend terminated mid-query due to OOM kill, network reset, or server restart.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.0.0
Identifier: PostgreSQL 08006: server closed the connection unexpectedly Platform: PostgreSQL

Interactive Diagnostic Checklist

Safe Diagnostic Command:
dmesg -T | grep -i oom && journalctl -u postgresql -n 40

Technical Explanation

Backend terminated mid-query due to OOM kill, network reset, or server restart. Verified technical resolution: Check host memory limits, shared_buffers sizing, and connection pool health checks.

Worked Examples

  • Diagnostic check: dmesg -T | grep -i oom && journalctl -u postgresql -n 40

Limitations & Assumptions

  • Confirm exact software version and execution layer before applying configuration changes in production.

Source References & Verification

Resource ID: err-pg-08006-connection-failure · Independently verified: 2026-11-25

Related Resources