↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / SQLSTATE

08000 — 连接异常(connection_exception)

连接管理异常的通用条件,如 FDW 连接不可用。

英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

aliases
未知
class name
Connection Exception
condition name
connection_exception
lang
en
sqlstate
08000

版本定义 PG 18

08000 — 连接异常

速览 {#at-a-glance}

SQLSTATE 08000 是 Class 08 中的 connection_exception。连接异常是一个宽泛的连接管理条件。固定 PostgreSQL 路径中,postgres_fdw 会在中止清理失败、外部服务器连接不可再用时使用它;单纯的客户端拒绝连接不足以证明此码。

含义 {#meaning}

连接异常是一个宽泛的连接管理条件。固定 PostgreSQL 路径中,postgres_fdw 会在中止清理失败、外部服务器连接不可再用时使用它;单纯的客户端拒绝连接不足以证明此码。

诊断 {#diagnosis}

检查服务器日志、外部服务器名、后端 PID、事务结果和 FDW 清理路径。将报文与 08001(无法建立连接)和 08006(已有连接失败)区分;客户端库可能返回另一种异常,甚至没有 SQLSTATE。

处理 {#response}

修复外部连接或清理条件,按具体路径结束失败事务;只有确认远端结果后,才重试完整且安全的业务单元。不要把普通网络异常改标为 08000。

报文 {#messages}

固定的 postgres_fdw 分支以 ERROR 发出主报文 connection to server "%s" cannot be used due to abort cleanup failure,外部服务器名是动态值。这个源码变体比普通客户端 socket 拒绝更具体。

代表案例 {#case}

本页没有选定的自然 SQL 运行。结构化证据记录的是源码或定义边界;客户端 RAISE 不能代表服务器机制。

版本 {#versions}

上面的生成事实表记录锁定的目录快照和最早观察到的定义。本页没有选定的自然 SQL 运行;固定的 REL_18_6/REL_10_23 源码边界不能当作实测结果,也不能据此推断所有中间版本的行为。

相关 {#related}

来源 {#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.

比较版本

SQLSTATE 证据与已记录的运行版本

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"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:c09bd2bc771cbaa2422a03794d4c91fd6026b7ba13ef954110275afbfcef6069

正文语言: zh-Hans · english-manuals:c09bd2bc771cbaa2422a03794d4c91fd6026b7ba13ef954110275afbfcef6069