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

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

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

HV002 fdw_dynamic_parameter_value_needed

需要外部数据包装器动态参数

ERROR 源码确认 参考 未实测

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

版本覆盖

速览

HV002 表示 FDW 操作所需的参数值不可用。PostgreSQL 18.6 自带的 file_fdw 在外部表选项校验期间发现 filenameprogram 都没有提供时报告此码。

含义与触发路径

contrib/file_fdw/file_fdw.c 的校验器检查 ForeignTableRelationId 的选项;两者都缺失时以 ERROR 报告 either filename or program is required for file_fdw foreign tables。条件名比这一实现更宽,其他包装器可能在规划、扫描或修改阶段需要不同参数并产生不同报文。

报文与诊断

18.6 固定变体来自 file_fdw_validator 第 345–350 行:ERROR: either filename or program is required for file_fdw foreign tables。固定的 9.1.24 源码使用 ERROR: filename is required for file_fdw foreign tables;两个源码模板都没有 detail 或 hint。这些都是本地选项校验错误,不表示远端程序启动失败。

报文模板

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

主消息 · observed either filename or program is required for file_fdw foreign tables

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

主消息 · observed filename is required for file_fdw foreign tables

来源:contrib/file_fdw/file_fdw.c @ REL9_1_24

诊断

检查具体的 CREATE FOREIGN TABLEALTER FOREIGN TABLE ... OPTIONS 定义及包装器接受的选项名。对 file_fdw,确认有一个可用的源选项且服务器进程能访问其值;其他包装器应查其校验器或回调的参数契约。

处理

按包装器要求补上正确拼写和权限的选项,或使用其支持的动态参数机制;随后重新校验。未改变 SQL 就重试不能生成缺失参数。

版本

目录从 9.1.0 观察到 HV002,延续到 18.6 和 19 Beta 3。固定的 9.1.24 file_fdw 源码使用 “filename is required”,固定的 18.6 源码使用 “either filename or program is required”,匹配报文时要看服务器版本;这里不声称具体的变更发布版本。

来源

证据

断言

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

  • HV002 is fdw_dynamic_parameter_value_needed in Class HV.

    核实方式Read the fixed definition row.

    来源src/backend/utils/errcodes.txt

  • file_fdw raises HV002 when neither filename nor program is supplied for a foreign table.

    核实方式Read file_fdw.c:345-350.

    不覆盖This is one bundled implementation; other wrappers can use the condition for different required parameters.

    来源contrib/file_fdw/file_fdw.c

  • The fixed 18.6 file_fdw source uses the filename-or-program message, while the fixed 9.1.24 source uses the filename-only wording.

    核实方式Read both fixed wrapper source files and compare the validator report templates.

    不覆盖These are two fixed wrapper snapshots; this does not claim the exact transition release or behavior of other wrappers.

    来源contrib/file_fdw/file_fdw.c · contrib/file_fdw/file_fdw.c

同类错误代码

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