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

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

百科 / 错误代码 / Class HV 外部数据包装器错误

HV001 fdw_out_of_memory

外部数据包装器内存不足

ERROR 源码确认 参考 未实测

类别
Class HV 外部数据包装器错误
严重等级
ERROR
条件名
fdw_out_of_memory
宏名称
ERRCODE_FDW_OUT_OF_MEMORY
启用版本
9.1
状态
活跃

版本覆盖

速览

HV001 是 FDW 内存不足条件。PostgreSQL 18.6 的 postgres_fdwdblinkPQconndefaults() 没有返回选项数组时使用它,postgres_fdw 复制选项的分配失败路径也使用它。固定源码报文是 out of memory,有些路径附带 Could not get libpq's default connection options.。它是 ERROR,远端操作是否已执行取决于阶段。

含义与触发路径

postgres_fdw 在构建选项列表时调用 PQconndefaults();空结果被视为分配失败并报告 HV001。随后为复制选项分配内存失败时也使用该码。dblink 有两个对应的选项发现路径。这是包装器实现细节,不能把所有 HV001 都解释为后端全局耗尽内存。

报文与诊断

18.6 的已确认变体包括:dblink 1972–19742908–2910postgres_fdw/option.c:317–319ERROR: out of memory 加 detail;option.c:340–341 只有主报文。应同时保留函数阶段和包装器名称;该报文不是远端服务器响应。

报文模板

源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。

主消息 · observed out of memory
DETAIL · observed Could not get libpq's default connection options.

来源:contrib/postgres_fdw/option.c @ REL_18_6

主消息 · observed out of memory

来源:contrib/postgres_fdw/option.c @ REL_18_6

主消息 · observed out of memory
DETAIL · observed Could not get libpq's default connection options.

来源:contrib/dblink/dblink.c @ REL_18_6

诊断

记录所有诊断字段,确认是在读取 FDW/服务器选项还是建立 dblink/postgres_fdw 连接时失败。检查后端内存压力、进程限制、包装器与 libpq 版本;detail 指向 libpq 默认选项时,先区分 PQconndefaults() 分配失败与 libpq 安装或配置问题,再把本地库路径/版本作为辅助证据,最后排查远端 SQL。

处理

降低并发内存压力并检查后端进程或容器限制,理解分配失败后再重试选项发现。若服务器实际报告的是 53200,应按该代码的诊断处理;若已确认是 HV001,不能仅因发生分配失败就改标为 53200。写操作要结合回调阶段和远端日志确认是否已发命令;单独的 HV001 不是整事务重试信号。

版本

目录从 9.1.0 观察到该码,并延续到 18.6 与 19 Beta 3。上述 18.6 路径和大小写固定到 commit 724edf9bde9d356724ad384a2e196edc3c9f80f7;旧版本措辞可能不同。

来源

证据

断言

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

  • HV001 is fdw_out_of_memory in SQL/MED Class HV.

    核实方式Read the fixed errcodes row and macro.

    来源src/backend/utils/errcodes.txt

  • postgres_fdw reports HV001 when PQconndefaults returns null and when allocation of its copied option array fails.

    核实方式Read option.c lines 313-341 and its adjacent failure comments.

    不覆盖The source assumes allocation failure for PQconndefaults; it does not prove global backend memory exhaustion.

    来源contrib/postgres_fdw/option.c

  • dblink reports HV001 when PQconndefaults returns null in two connection-option paths.

    核实方式Read dblink.c lines 1968-1974 and 2904-2910.

    不覆盖dblink is a separate contrib client API, not an FDW callback implementation.

    来源contrib/dblink/dblink.c

同类错误代码

Class HV 外部数据包装器错误 下的其他成员。