SQLSTATE 08006Severity mediumLab verified

Incident brief

Connection to client lost

A client was abruptly killed mid-query, severing the connection while the server still had output to send. PostgreSQL logged SQLSTATE 08006 and cleaned up that backend.

What lands in your log

FATAL: connection to client lost

Reproduced on PostgreSQL 16.14Verified 2026-07-16 (Docker lab, PostgreSQL 16.14)Verified against PostgreSQL 16.14 in an isolated lab environment

In 10 seconds

What triggers it
Start a query from a client, then kill the client process outright (SIGKILL) before it finishes.
Fix
There's nothing to fix server-side for a single abrupt kill, this is PostgreSQL correctly detecting and cleaning up after a dead connection.
Proof
Reproduced on PostgreSQL 16.14 → Killing a client process outright (SIGKILL) mid-query produced a real broken-pipe/lost-connection entry in the server log tagged SQLSTATE 08006. An ordinary clean disconnect produced no such entry.

Fix

What to do right now

Application-level steps for this error.

  • There's nothing to fix server-side for a single abrupt kill, this is PostgreSQL correctly detecting and cleaning up after a dead connection.
  • If this happens routinely in production, look at what's killing the client (OOM killer, container restarts, load balancer timeouts) rather than at PostgreSQL.
Fix SQL
-- No corrective SQL on the server for a single abrupt client kill.
-- Investigate the client path instead (examples):
--   * load balancer / proxy idle timeouts shorter than long queries
--   * container OOM kills (exit 137) on the app side
--   * network path drops mid-result
-- Confirm in the server log: SQLSTATE 08006 "connection to client lost"

Connected

Everything this error touches

Every page this SQLSTATE connects to: the concept that explains it, the runbooks that fix it, the parameters you tune to prevent it, and the sibling errors it travels with. All real cross-references. Jump straight in, or open the full interactive map.

Open in the interactive map →

Verification

PG 16.14
Last verified
2026-07-16 (Docker lab, PostgreSQL 16.14)
Verification scope
Verified against PostgreSQL 16.14 in an isolated lab environment
Audit status
reviewed
ShareLinkedInX

Went further?

Pro unlocks the second lab proof

Free page stops the bleeding. Pro adds the operational test, SQLSTATE audit, and deeper evidence, same error, more certainty.

FollowSubstackLinkedInnew errors · lab notes · hiring loops