选择 打开 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

文档 / SQL 状态码 / Class 08 连接异常

08004 sqlserver_rejected_establishment_of_sqlconnection

服务器拒绝建立 SQL 连接

ERROR 仅定义 参考 未实测

类别
Class 08 连接异常
严重等级
ERROR
条件名
sqlserver_rejected_establishment_of_sqlconnection
宏名称
ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION
启用版本
7.4
状态
活跃

版本覆盖

速览

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

含义

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

诊断

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

处理

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

可复现案例

在一次性实例上执行过的场景。

source_boundary PG 10 / 18

前置条件

  • A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested.

触发

No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.

处置

Use the concrete source path or component-specific documentation when it applies.

清理

Drop the case schema with an owner connection.

报文

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

代表案例

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

版本

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

来源

证据

断言

每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。

  • 08004 is the sqlserver_rejected_establishment_of_sqlconnection condition in Class 08.

    核实方式Read the fixed errcodes.txt definition and the locked catalogue metadata.

    不覆盖Directory identity does not identify every backend or client path.

    来源src/backend/utils/errcodes.txt

  • 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.

    核实方式Trace the fixed REL_18_6 and REL_10_23 source call scans and the recorded source paths.

    不覆盖This is a bounded source claim; it is not an observed natural SQLSTATE case.

    来源raw/calls/REL_18_6.jsonl · raw/calls/REL_10_23.jsonl

  • 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.

    核实方式Read the generated facts block and bounded fixed source/call-scan records; no runtime target summaries are used.

    不覆盖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.

    来源src/backend/utils/errcodes.txt · raw/calls/REL_18_6.jsonl · raw/calls/REL_10_23.jsonl

同类 SQL 状态码

状态码 条件名 宏名称 严重等级 版本
Class 08 连接异常 Connection Exception 7 个
08000 connection_exception ERRCODE_CONNECTION_EXCEPTION ERROR 7.4
连接管理异常的通用条件,如 FDW 连接不可用。 活跃
08001 sqlclient_unable_to_establish_sqlconnection ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ERROR 7.4
无法建立到目标服务器的新连接。 活跃
08003 connection_does_not_exist ERRCODE_CONNECTION_DOES_NOT_EXIST ERROR 7.4
指定名称的连接句柄在会话中不存在。 活跃
08004 sqlserver_rejected_establishment_of_sqlconnection ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION ERROR 7.4
服务器拒绝建立 SQL 连接。 活跃
08006 connection_failure ERRCODE_CONNECTION_FAILURE ERROR 7.4
与服务器的连接在会话中途失败。 活跃
08007 transaction_resolution_unknown ERRCODE_TRANSACTION_RESOLUTION_UNKNOWN ERROR 7.4
连接中断导致事务提交结果未知。 活跃
08P01 protocol_violation ERRCODE_PROTOCOL_VIOLATION ERROR 7.4
前后端消息违反线路协议,通常是 FATAL。 活跃