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

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

Wiki / SQLSTATE

08004 — 服务器拒绝建立 SQL 连接(sqlserver_rejected_establishment_of_sqlconnection)

服务器拒绝建立 SQL 连接。

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

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

aliases
未知
class name
Connection Exception
condition name
sqlserver_rejected_establishment_of_sqlconnection
lang
en
sqlstate
08004

版本定义 PG 18

08004 — 服务器拒绝建立 SQL 连接

速览 {#at-a-glance}

SQLSTATE 08004 是 Class 08 中的 sqlserver_rejected_establishment_of_sqlconnection。08004 是 SQL 标准中“服务器拒绝建立连接”的名称。固定的 PostgreSQL 18.6 与 10.23 核心调用扫描没有解析出该码的 PostgreSQL ereport 路径。

含义 {#meaning}

08004 是 SQL 标准中“服务器拒绝建立连接”的名称。固定的 PostgreSQL 18.6 与 10.23 核心调用扫描没有解析出该码的 PostgreSQL ereport 路径。

诊断 {#diagnosis}

用服务器 ErrorResponse 和认证日志识别具体条件。本范围内 PostgreSQL 路径使用 28000、28P01 等更具体的码;只有客户端异常、没有服务器字段时,不能据此认定 08004。

处理 {#response}

修复实际认证、授权或端点问题后建立新连接。本页只记录定义与源码边界,不用客户端 RAISE 或伪造登录失败来冒充自然机制。

报文 {#messages}

本范围没有确认 08004 的固定主报文模板;现有定义/源码记录不足以建立固定文本。只有客户端异常而没有匹配的服务器诊断时,不能据此认定 08004。

代表案例 {#case}

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

版本 {#versions}

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

相关 {#related}

来源 {#sources}

  • src.errcodes.18.6 — src/backend/utils/errcodes.txt at REL_18_6 commit 724edf9bde9d356724ad384a2e196edc3c9f80f7; fixed blob SHA-256 6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba (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": "08004 is the sqlserver_rejected_establishment_of_sqlconnection 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.calls.REL_18_6",
    "src.calls.REL_10_23"
  ],
  "statement": "The fixed core scans contain no resolved PostgreSQL throw site for 08004. Keep the SQL-standard definition separate from concrete startup codes such as 28000 and 28P01."
}
claims · versions.catalogue-boundary
{
  "claim_id": "versions.catalogue-boundary",
  "limits": "Presence in a definition file is not an exact behavioral introduction; this scope establishes no resolved fixed core emitter or universal message template and does not prove every intermediate release.",
  "method": "Read the generated facts block and bounded fixed source/call-scan records; no runtime target summaries are used.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6",
    "src.calls.REL_18_6",
    "src.calls.REL_10_23"
  ],
  "statement": "The locked catalogue records 08004 in the listed snapshots; this definition/source-only page has no selected natural runtime and only compares the fixed catalogue and bounded REL_18_6/REL_10_23 call-scan records."
}
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 · manifest.08004
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/08004/cases.json",
  "position": 3,
  "sha256": "533ef5ec3f8813715da35f9daff8dcdd515e7ea1dcfe3ddb065993519c67b819",
  "source_id": "manifest.08004",
  "tag": "workspace",
  "url": "verify/cases/08004/cases.json"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:1f5831b5a65fb9ef8a6e60a1dcca05ede3ca0aa1b9e2e271dedf8c9697f004c5

正文语言: zh-Hans · english-manuals:1f5831b5a65fb9ef8a6e60a1dcca05ede3ca0aa1b9e2e271dedf8c9697f004c5