↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / SQLSTATE

08000 — connection_exception

SQLSTATE 08000 is connection_exception in Class 08. Connection exception is a broad connection-management condition. In the fixed PostgreSQL paths it is used by postgres_fdw when an abort-cleanup failure makes a foreign-server connection unusable; a refused client socket is not enough to claim this code.

English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

aliases
Unknown
class name
Connection Exception
condition name
connection_exception
lang
en
sqlstate
08000

Definition PG 18

08000

At a glance {#at-a-glance}

SQLSTATE 08000 is connection_exception in Class 08. Connection exception is a broad connection-management condition. In the fixed PostgreSQL paths it is used by postgres_fdw when an abort-cleanup failure makes a foreign-server connection unusable; a refused client socket is not enough to claim this code.

Meaning {#meaning}

Connection exception is a broad connection-management condition. In the fixed PostgreSQL paths it is used by postgres_fdw when an abort-cleanup failure makes a foreign-server connection unusable; a refused client socket is not enough to claim this code.

Diagnosis {#diagnosis}

Inspect the server log and the foreign server name, backend PID, transaction outcome, and FDW cleanup path. Compare the message with 08001 (a connection could not be established) and 08006 (an established connection failed). A client library can expose a different exception or no SQLSTATE.

Response {#response}

Repair the foreign connection or its cleanup condition, finish the failed transaction according to the exact path, and retry the complete safe unit only after the remote outcome is known. Do not relabel a generic network exception as 08000.

Messages {#messages}

The fixed postgres_fdw branch emits ERROR with primary connection to server "%s" cannot be used due to abort cleanup failure; the foreign server name is dynamic. This source-backed variant is narrower than a generic client socket refusal.

Representative case {#case}

This page has no selected natural SQL run. The structured evidence records a source or definition boundary; a client-side RAISE would not represent a backend mechanism.

Versions {#versions}

The generated facts table records the locked catalogue snapshots and earliest observed definition. This page has no selected natural SQL run; its fixed REL_18_6/REL_10_23 source boundary must not be read as an observed runtime result or as a claim about every intermediate release.

Related {#related}

Sources {#sources}

  • src.fdw-connection.18.6 — contrib/postgres_fdw/connection.c at REL_18_6 commit 724edf9bde9d356724ad384a2e196edc3c9f80f7; fixed blob SHA-256 67fc002657f2c7df6d93cbf99c933cbc103907d1857ed77aedbb85099ea4dda0 (source).
  • src.fdw-connection.10.23 — contrib/postgres_fdw/connection.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 8a8b053e4ef599d95d0709744aa1dd5bb20047af9dc29b3f42cfba5785e525c5 (source).
  • src.calls.REL_18_6 / src.calls.REL_10_23 — fixed local call scans, SHA-256 9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf / 00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c; these scans preserve the resolved call context used by the claims.

Compare versions

SQLSTATE evidence and recorded runtime versions

cases · source_boundary
{
  "assertions": [],
  "case_id": "source_boundary",
  "cleanup": "Drop the case schema with an owner connection.",
  "has_snippet": false,
  "position": 0,
  "preconditions": [
    "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
  ],
  "repair": "Use the concrete source path or component-specific documentation when it applies.",
  "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
  "versions": [
    "10",
    "18"
  ]
}
claims · identity.class-and-condition
{
  "claim_id": "identity.class-and-condition",
  "limits": "Directory identity does not identify every backend or client path.",
  "method": "Read the fixed errcodes.txt definition and the locked catalogue metadata.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "08000 is the connection_exception condition in Class 08."
}
claims · mechanism.source-boundary
{
  "claim_id": "mechanism.source-boundary",
  "limits": "This is a bounded source claim; it is not an observed natural SQLSTATE case.",
  "method": "Trace the fixed REL_18_6 and REL_10_23 source call scans and the recorded source paths.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.fdw-connection.18.6",
    "src.fdw-connection.10.23"
  ],
  "statement": "The source scan resolves this class code to `postgres_fdw` abort-cleanup handling when a foreign connection cannot be discarded cleanly. It is source-path evidence, not a general socket failure case."
}
claims · versions.catalogue-boundary
{
  "claim_id": "versions.catalogue-boundary",
  "limits": "Presence in a definition file is not an exact behavioral introduction, and the fixed source records do not prove every intermediate release or ordinary client connection failure.",
  "method": "Read the generated facts block and fixed postgres_fdw source/call records; no runtime target summaries are used for this page.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6",
    "src.calls.REL_18_6",
    "src.calls.REL_10_23"
  ],
  "statement": "The locked catalogue records 08000 in the listed snapshots; this source-only page compares the fixed REL_18_6 and REL_10_23 postgres_fdw source/call records and has no selected natural runtime."
}
messages · message.fdw-abort-cleanup
{
  "limits": "The foreign server name is dynamic; this fixed postgres_fdw branch is not a generic client socket refusal.",
  "message_id": "message.fdw-abort-cleanup",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.fdw-abort-cleanup",
    "limits": "The foreign server name is dynamic; this fixed postgres_fdw branch is not a generic client socket refusal.",
    "primary_template": "connection to server \"%s\" cannot be used due to abort cleanup failure",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.fdw-connection.18.6",
      "src.fdw-connection.10.23"
    ],
    "sqlstate": "08000"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.fdw-connection.18.6",
    "src.fdw-connection.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "connection to server \" \" cannot be used due to abort cleanup failure",
      "position": 0,
      "role": "",
      "template": "connection to server \"%s\" cannot be used due to abort cleanup failure"
    }
  ]
}
sources · src.errcodes.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 1,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "REL_18_6",
  "url": ""
}
sources · src.calls.REL_10_23
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_10_23.jsonl",
  "position": 2,
  "sha256": "00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c",
  "source_id": "src.calls.REL_10_23",
  "tag": "REL_10_23",
  "url": ""
}
sources · src.fdw-connection.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "contrib/postgres_fdw/connection.c",
  "position": 3,
  "sha256": "67fc002657f2c7df6d93cbf99c933cbc103907d1857ed77aedbb85099ea4dda0",
  "source_id": "src.fdw-connection.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/postgres_fdw/connection.c#L1369-L1372"
}
sources · src.fdw-connection.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "contrib/postgres_fdw/connection.c",
  "position": 4,
  "sha256": "8a8b053e4ef599d95d0709744aa1dd5bb20047af9dc29b3f42cfba5785e525c5",
  "source_id": "src.fdw-connection.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/contrib/postgres_fdw/connection.c#L1033-L1036"
}
sources · manifest.08000
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/08000/cases.json",
  "position": 5,
  "sha256": "db1a8c9acb66b739158ea9cf305f3e31228e0d214a6a43cfcdbc013667cbc5e2",
  "source_id": "manifest.08000",
  "tag": "workspace",
  "url": "verify/cases/08000/cases.json"
}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · english-manuals:c09bd2bc771cbaa2422a03794d4c91fd6026b7ba13ef954110275afbfcef6069

Text language: en · english-manuals:c09bd2bc771cbaa2422a03794d4c91fd6026b7ba13ef954110275afbfcef6069