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.

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

In 10 seconds

What
Connection to client lost
What triggers it
Start a query from a client, then kill the client process outright (SIGKILL) before it finishes.
The 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.

The fix

What to do right now

The immediate, application-level response to 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
-- There is no "fix" SQL here: the server's behavior (detect the broken pipe,
-- log 08006, and clean up the backend) is already correct.
SELECT 1 AS clean_disconnect_example;

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

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