Skip to main content
SQLSTATE 08006

PostgreSQL connection_failure

An established PostgreSQL connection failed while the client was using it, leaving the current operation interrupted or uncertain.

PostgreSQL client/server connectionConnectivityhigh
Exact message
connection failure

Also searched as: connection_failure · server closed the connection unexpectedly

What it means

The client lost a session because of server termination, network interruption, proxy timeout, process failure, or protocol-level disruption. The SQLSTATE alone does not establish which layer failed.

Typical trigger conditions

  • Database restart or failover
  • Load balancer or firewall idle timeout
  • Backend process crash
  • Network path interruption
Evidence before intervention

First diagnostic checks

1

Correlate both ends

Compare application, pooler, PostgreSQL and infrastructure events by timestamp and connection identity.

2

Test a fresh connection

Determine whether the endpoint is currently reachable without reusing the failed pool session.

pg_isready -h <host> -p <port> -d <database>
3

Review timeout layers

Compare client, pooler, proxy, firewall and server keepalive settings.

Version and platform notes

The class 08 SQLSTATE is stable; the accompanying driver exception and server log usually provide the discriminating evidence.

Engineering signal

Follow PostgreSQL failures and fixes

One useful weekly email with new error references, tools, integration notes and production lessons. No daily noise.