{
  "schema": 1,
  "sqlstate": "08006",
  "condition_name": "connection_failure",
  "sources": [
    {
      "id": "src.errcodes.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
      "tag": "REL_18_6"
    },
    {
      "id": "src.calls.REL_10_23",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c",
      "tag": "REL_10_23"
    },
    {
      "id": "src.fdw-connection-failure.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "contrib/postgres_fdw/connection.c",
      "sha256": "67fc002657f2c7df6d93cbf99c933cbc103907d1857ed77aedbb85099ea4dda0",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/postgres_fdw/connection.c#L1462-L1464"
    },
    {
      "id": "src.copy-connection-failure.10.23",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_10_23",
      "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
      "path": "src/backend/commands/copy.c",
      "sha256": "0edb032be1ce8d8c90efc28e504aa9e298a2cd26cd374c85da6da0e33ed0915c",
      "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/commands/copy.c#L525-L527"
    },
    {
      "id": "manifest.08006",
      "kind": "local_artifact",
      "source_role": "case_manifest",
      "sha256": "205dd83742e554dc0ceb466ed9acd023f538785306e2a2b29a7ec3842a8f50af",
      "tag": "workspace"
    },
    {
      "id": "src.copy-client-eof.18.6",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/copyfromparse.c",
      "sha256": "bc42754023579cd782a3cb3f144ad2c2c3d3aa46119eb7567fcdb05f2d445571",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/copyfromparse.c#L276-L303"
    },
    {
      "id": "src.copy-client-eof.10.23",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_10_23",
      "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
      "path": "src/backend/commands/copy.c",
      "sha256": "0edb032be1ce8d8c90efc28e504aa9e298a2cd26cd374c85da6da0e33ed0915c",
      "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/commands/copy.c#L587-L614"
    },
    {
      "id": "doc.transactions.18",
      "kind": "upstream_source",
      "source_role": "transaction_recovery_documentation",
      "tag": "PG18-docs",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/xact.sgml",
      "sha256": "b48fbe8bd02ce3d1181a350c88c8baa6e11c73edc90a936e77b180daef328c5c",
      "url": "https://www.postgresql.org/docs/18/tutorial-transactions.html"
    }
  ],
  "claims": [
    {
      "id": "identity.class-and-condition",
      "statement": "08006 is the connection_failure condition in Class 08.",
      "method": "Read the fixed errcodes.txt definition and the locked catalogue metadata.",
      "limits": "Directory identity does not identify every backend or client path.",
      "sources": [
        "src.errcodes.18.6"
      ]
    },
    {
      "id": "mechanism.source-boundary",
      "statement": "The fixed source paths resolve 08006 to distinct established-connection failure branches: postgres_fdw cancel warnings, a COPY-to-stdout FATAL in REL_10_23, and COPY client-EOF ERROR paths in REL_18_6 and REL_10_23. The exact diagnostic and severity depend on where the connection loss is detected.",
      "method": "Trace the fixed REL_18_6 and REL_10_23 source call scans and the recorded source paths.",
      "limits": "This is a bounded source claim; this batch has no selected natural 08006 runtime, and it does not claim that an ordinary client socket failure exposes this SQLSTATE.",
      "sources": [
        "src.fdw-connection-failure.18.6",
        "src.copy-connection-failure.10.23",
        "src.copy-client-eof.18.6",
        "src.copy-client-eof.10.23"
      ]
    },
    {
      "id": "recovery-boundary",
      "statement": "The fixed 08006 variants have different recovery contracts: the COPY client-EOF ERROR detects that the triggering client socket is already at EOF and therefore does not establish a reusable session for sending ROLLBACK; an independently still-connected ERROR can require rollback or savepoint recovery, while FATAL ends the backend; a client EOF without an ErrorResponse may expose no SQLSTATE.",
      "method": "Combine the COPY client-EOF source branch, recorded source severities, and the official transaction and savepoint recovery contract.",
      "limits": "This is a source-backed boundary; the COPY EOF branch says nothing about reusing the already-lost client socket, and this batch selected no natural 08006 runtime or ordinary socket failure.",
      "sources": [
        "mechanism.source-boundary",
        "doc.transactions.18"
      ]
    },
    {
      "id": "versions.catalogue-boundary",
      "statement": "The locked catalogue records 08006 in the listed snapshots; this page compares only the fixed REL_18_6 and REL_10_23 source paths and has no selected natural runtime.",
      "method": "Read the generated facts block and fixed source records; no runtime result is used for this source-only page.",
      "limits": "Presence in a definition file is not an exact behavioral introduction, and the fixed source paths do not prove every intermediate release or socket failure.",
      "sources": [
        "src.errcodes.18.6",
        "src.copy-client-eof.18.6",
        "src.copy-client-eof.10.23"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.fdw-cancel-send",
      "sqlstate": "08006",
      "severity_source": "explicit WARNING",
      "sources": [
        "src.fdw-connection-failure.18.6"
      ],
      "primary_template": "could not send cancel request: %s",
      "limits": "The %s value is the dynamic libpq/cancel error text."
    },
    {
      "id": "message.fdw-cancel-result",
      "sqlstate": "08006",
      "severity_source": "explicit WARNING",
      "sources": [
        "src.fdw-connection-failure.18.6"
      ],
      "primary_template": "could not get result of cancel request: %s",
      "limits": "The %s value is the dynamic error text returned while reading the cancel result; the fixed source has more than one call site."
    },
    {
      "id": "message.copy-connection-lost",
      "sqlstate": "08006",
      "severity_source": "explicit FATAL",
      "sources": [
        "src.copy-connection-failure.10.23"
      ],
      "primary_template": "connection lost during COPY to stdout",
      "limits": "This exact fixed branch is recorded from REL_10_23; the page does not generalize it to every COPY direction or release."
    },
    {
      "id": "message.copy-client-eof-open-tx",
      "sqlstate": "08006",
      "severity_source": "explicit ERROR",
      "sources": [
        "src.copy-client-eof.18.6",
        "src.copy-client-eof.10.23"
      ],
      "primary_template": "unexpected EOF on client connection with an open transaction",
      "limits": "The fixed COPY client-EOF path reports this when an open transaction is present; the source confirms the branch, not a selected natural run in this batch."
    }
  ],
  "usage_evidence": [
    {
      "scope": "SQLSTATE directory identity",
      "status": "definition_only",
      "evidence_ids": [
        "identity.class-and-condition",
        "src.errcodes.18.6"
      ]
    },
    {
      "scope": "Fixed source or definition boundary",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.source-boundary",
        "src.fdw-connection-failure.18.6",
        "src.copy-connection-failure.10.23",
        "src.copy-client-eof.18.6",
        "src.copy-client-eof.10.23",
        "recovery-boundary",
        "doc.transactions.18"
      ]
    },
    {
      "scope": "Locked release presence and bounded version comparison",
      "status": "definition_only",
      "evidence_ids": [
        "versions.catalogue-boundary",
        "src.errcodes.18.6"
      ]
    }
  ],
  "runtime": []
}
