文档 / SQL 状态码 / Class HV 外部数据包装器错误
HV00D fdw_invalid_option_name
ERROR 源码确认 参考 未实测
- 条件名
fdw_invalid_option_name- 宏名称
ERRCODE_FDW_INVALID_OPTION_NAME- 启用版本
- 9.1
- 状态
- 活跃
版本覆盖
速览
当 FDW 选项名称不符合当前包装器上下文时,会产生 HV00D。PostgreSQL 18.6 在 file_fdw、postgres_fdw 以及 postgres_fdw 的导入选项解析器中都有直接路径。
含义与消息
包装器会按当前上下文检查选项:可能是 FDW、服务器、外部表、用户映射或导入。18.6 的主消息模板是 invalid option "%s"。file_fdw 与 postgres_fdw/option.c 只有在找到足够相近名称时才提示 Perhaps you meant the option "%s".;若存在合法选项但没有相近候选,源码不发送 hint;只有不存在任何合法选项时才提示 There are no valid options in this context.。postgres_fdw 导入解析器只有主消息。
诊断
记录正在修改的对象和包装器版本,然后查看该包装器的验证逻辑与选项表。确认选项属于服务器、外部表还是用户映射;同名选项可能只在其中一个范围有效。保留消息中的相近名称,不要套用其他包装器的选项表。
处理
使用已安装包装器在该范围支持的名称,或删除不支持的选项。若选项来自较新的扩展,先确认版本差异确实是原因,再协调扩展与服务器版本。重复相同定义不会改变验证结果。
消息与诊断
18.6 的确认路径位于 file_fdw、postgres_fdw 选项验证器和 postgres_fdw 导入选项解析器,严重级别均为 ERROR。%s 代表动态选项名称或相近名称;提示会随匹配结果变化。
报文模板
源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。
Perhaps you meant the option "%s".
There are no valid options in this context.
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.
Perhaps you meant the option "%s".
There are no valid options in this context.
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.
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.
Valid options in this context are: %s
invalid option "%s"
Valid options in this context are: %s
invalid option "%s"
版本
HV00D 从 9.1.0 到 18.6 以及 19 Beta 3 均存在。固定的 REL9_6_24 file_fdw 与 postgres_fdw 验证器快照使用较早的 Valid options in this context are: %s 提示,而固定的 18.6 路径使用相近名称或无可用选项的提示。这两个快照只界定措辞范围,不能确定具体切换版本;比较日志时应以实际安装版本为准。
来源
- 上游源码 src/backend/utils/errcodes.txt
- 上游源码 contrib/file_fdw/file_fdw.c
- 上游源码 contrib/file_fdw/file_fdw.c 第 240–246 行
- 上游源码 contrib/postgres_fdw/postgres_fdw.c
- 上游源码 contrib/postgres_fdw/option.c
- 上游源码 contrib/postgres_fdw/option.c 第 99–103 行
- 核验材料 raw/calls/REL_18_6.jsonl
证据
断言
每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。
-
HV00D is fdw_invalid_option_name in SQL/MED Class HV.
-
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.
-
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.
同类 SQL 状态码
| 状态码 | 条件名 | 宏名称 | 严重等级 | 版本 |
|---|---|---|---|---|
| HV000 | fdw_error | ERRCODE_FDW_ERROR |
ERROR | 9.1 |
| 外部数据包装器的通用错误,需看包装器诊断。 | 活跃 | |||
| HV001 | fdw_out_of_memory | ERRCODE_FDW_OUT_OF_MEMORY |
ERROR | 9.1 |
| 包装器分配内存失败,如获取 libpq 默认选项时。 | 活跃 | |||
| HV002 | fdw_dynamic_parameter_value_needed | ERRCODE_FDW_DYNAMIC_PARAMETER_VALUE_NEEDED |
ERROR | 9.1 |
| 包装器缺少必需的参数值,如未给 filename。 | 活跃 | |||
| HV004 | fdw_invalid_data_type | ERRCODE_FDW_INVALID_DATA_TYPE |
ERROR | 9.1 |
| 包装器无法使用该数据类型,类型映射不匹配。 | 活跃 | |||
| HV005 | fdw_column_name_not_found | ERRCODE_FDW_COLUMN_NAME_NOT_FOUND |
ERROR | 9.1 |
| 包装器在远端或描述符中找不到该外部列名。 | 活跃 | |||
| HV006 | fdw_invalid_data_type_descriptors | ERRCODE_FDW_INVALID_DATA_TYPE_DESCRIPTORS |
ERROR | 9.1 |
| 包装器的数据类型描述符不一致或不可用。 | 活跃 | |||
| HV007 | fdw_invalid_column_name | ERRCODE_FDW_INVALID_COLUMN_NAME |
ERROR | 9.1 |
| 传给包装器的列名无效,不符合命名规则。 | 活跃 | |||
| HV008 | fdw_invalid_column_number | ERRCODE_FDW_INVALID_COLUMN_NUMBER |
ERROR | 9.1 |
| 包装器描述符收到超出范围的列序号。 | 活跃 | |||
| HV009 | fdw_invalid_use_of_null_pointer | ERRCODE_FDW_INVALID_USE_OF_NULL_POINTER |
ERROR | 9.1 |
| 包装器边界上非法使用了空指针。 | 活跃 | |||
| HV00A | fdw_invalid_string_format | ERRCODE_FDW_INVALID_STRING_FORMAT |
ERROR | 9.1 |
| 包装器无法接受该字符串的格式。 | 活跃 | |||
| HV00B | fdw_invalid_handle | ERRCODE_FDW_INVALID_HANDLE |
ERROR | 9.1 |
| 包装器收到未知、已关闭或无效的句柄。 | 活跃 | |||
| HV00C | fdw_invalid_option_index | ERRCODE_FDW_INVALID_OPTION_INDEX |
ERROR | 9.1 |
| 包装器处理自身选项数组时收到无效索引。 | 活跃 | |||
| HV00D | fdw_invalid_option_name | ERRCODE_FDW_INVALID_OPTION_NAME |
ERROR | 9.1 |
| 当前上下文不接受该外部数据包装器选项名。 | 活跃 | |||
| HV00J | fdw_option_name_not_found | ERRCODE_FDW_OPTION_NAME_NOT_FOUND |
ERROR | 9.1 |
| dblink 连接选项不在接受的选项集合中。 | 活跃 | |||
| HV00K | fdw_reply_handle | ERRCODE_FDW_REPLY_HANDLE |
ERROR | 9.1 |
| 包装器读取回复时收到无效的回复句柄。 | 活跃 | |||
| HV00L | fdw_unable_to_create_execution | ERRCODE_FDW_UNABLE_TO_CREATE_EXECUTION |
ERROR | 9.1 |
| 包装器准备执行时无法创建执行对象。 | 活跃 | |||
| HV00M | fdw_unable_to_create_reply | ERRCODE_FDW_UNABLE_TO_CREATE_REPLY |
ERROR | 9.1 |
| 包装器无法创建存放结果的回复对象。 | 活跃 | |||
| HV00N | fdw_unable_to_establish_connection | ERRCODE_FDW_UNABLE_TO_ESTABLISH_CONNECTION |
ERROR | 9.1 |
| 包装器无法与外部数据源建立连接。 | 活跃 | |||
| HV00P | fdw_no_schemas | ERRCODE_FDW_NO_SCHEMAS |
ERROR | 9.1 |
| 包装器不支持 IMPORT FOREIGN SCHEMA 导入。 | 活跃 | |||
| HV00Q | fdw_schema_not_found | ERRCODE_FDW_SCHEMA_NOT_FOUND |
ERROR | 9.1 |
| IMPORT FOREIGN SCHEMA 找不到请求的远端模式。 | 活跃 | |||
| HV00R | fdw_table_not_found | ERRCODE_FDW_TABLE_NOT_FOUND |
ERROR | 9.1 |
| 包装器在外部数据源中找不到请求的表。 | 活跃 | |||
| HV010 | fdw_function_sequence_error | ERRCODE_FDW_FUNCTION_SEQUENCE_ERROR |
ERROR | 9.1 |
| 包装器的函数被以无效的顺序调用。 | 活跃 | |||
| HV014 | fdw_too_many_handles | ERRCODE_FDW_TOO_MANY_HANDLES |
ERROR | 9.1 |
| 包装器的句柄数量达到上限。 | 活跃 | |||
| HV021 | fdw_inconsistent_descriptor_information | ERRCODE_FDW_INCONSISTENT_DESCRIPTOR_INFORMATION |
ERROR | 9.1 |
| 包装器描述符中的信息互相不一致。 | 活跃 | |||
| HV024 | fdw_invalid_attribute_value | ERRCODE_FDW_INVALID_ATTRIBUTE_VALUE |
ERROR | 9.1 |
| 包装器拒绝了某个属性值,取值无效。 | 活跃 | |||
| HV090 | fdw_invalid_string_length_or_buffer_length | ERRCODE_FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH |
ERROR | 9.1 |
| 包装器边界的字符串或缓冲区长度无效。 | 活跃 | |||
| HV091 | fdw_invalid_descriptor_field_identifier | ERRCODE_FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER |
ERROR | 9.1 |
| 包装器无法使用该描述符字段标识符。 | 活跃 | |||