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

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

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

HV00D fdw_invalid_option_name

ERROR 源码确认 参考 未实测

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

版本覆盖

速览

当 FDW 选项名称不符合当前包装器上下文时,会产生 HV00D。PostgreSQL 18.6 在 file_fdwpostgres_fdw 以及 postgres_fdw 的导入选项解析器中都有直接路径。

含义与消息

包装器会按当前上下文检查选项:可能是 FDW、服务器、外部表、用户映射或导入。18.6 的主消息模板是 invalid option "%s"file_fdwpostgres_fdw/option.c 只有在找到足够相近名称时才提示 Perhaps you meant the option "%s".;若存在合法选项但没有相近候选,源码不发送 hint;只有不存在任何合法选项时才提示 There are no valid options in this context.postgres_fdw 导入解析器只有主消息。

诊断

记录正在修改的对象和包装器版本,然后查看该包装器的验证逻辑与选项表。确认选项属于服务器、外部表还是用户映射;同名选项可能只在其中一个范围有效。保留消息中的相近名称,不要套用其他包装器的选项表。

处理

使用已安装包装器在该范围支持的名称,或删除不支持的选项。若选项来自较新的扩展,先确认版本差异确实是原因,再协调扩展与服务器版本。重复相同定义不会改变验证结果。

消息与诊断

18.6 的确认路径位于 file_fdwpostgres_fdw 选项验证器和 postgres_fdw 导入选项解析器,严重级别均为 ERROR%s 代表动态选项名称或相近名称;提示会随匹配结果变化。

报文模板

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

HINT Perhaps you meant the option "%s".
HINT There are no valid options in this context.
主消息 · observed invalid option "%s"

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

适用范围:When valid options exist but no close match is found, the source emits no hint; the no-valid-options hint is only used when no valid option exists.

HINT Perhaps you meant the option "%s".
HINT There are no valid options in this context.
主消息 · observed invalid option "%s"

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

适用范围:When valid options exist but no close match is found, the source emits no hint; the no-valid-options hint is only used when no valid option exists.

主消息 · observed invalid option "%s"

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

适用范围:This import-option parser has only the primary message in the fixed 18.6 path; it does not use the validator close-match or no-valid-options hint branches.

HINT Valid options in this context are: %s
主消息 · observed invalid option "%s"

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

HINT Valid options in this context are: %s
主消息 · observed invalid option "%s"

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

版本

HV00D 从 9.1.0 到 18.6 以及 19 Beta 3 均存在。固定的 REL9_6_24 file_fdwpostgres_fdw 验证器快照使用较早的 Valid options in this context are: %s 提示,而固定的 18.6 路径使用相近名称或无可用选项的提示。这两个快照只界定措辞范围,不能确定具体切换版本;比较日志时应以实际安装版本为准。

来源

证据

断言

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

  • HV00D is fdw_invalid_option_name in SQL/MED Class HV.

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

    来源src/backend/utils/errcodes.txt

  • file_fdw and postgres_fdw validate option names in their object-specific contexts; the postgres_fdw import parser uses the same condition for an invalid import option.

    核实方式Read each fixed error branch and its option context.

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

  • Fixed REL9_6_24 snapshots of file_fdw and postgres_fdw/option.c use the older dynamic hint 'Valid options in this context are: %s' with the same invalid-option ERROR; this is a bounded snapshot comparison, not an exact transition release.

    核实方式Read the fixed REL9_6_24 error branches at file_fdw.c:240-246 and postgres_fdw/option.c:99-103.

    不覆盖The two fixed wrapper snapshots establish their own wording only; they do not date the transition or describe every wrapper.

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

同类错误代码

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