HV002 — fdw_dynamic_parameter_value_needed(需要外部数据包装器动态参数)
包装器缺少必需的参数值,如未给 filename。
英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 18·选择有来源记录的版本
- aliases
- 未知
- class name
- Foreign Data Wrapper Error (SQL/MED)
- condition name
- fdw_dynamic_parameter_value_needed
- lang
- en
- sqlstate
- HV002
版本定义 PG 18
HV002 — fdw_dynamic_parameter_value_needed
速览 {#at-a-glance}
HV002 表示 FDW 操作所需的参数值不可用。PostgreSQL 18.6 自带的 file_fdw 在外部表选项校验期间发现 filename 和 program 都没有提供时报告此码。
含义与触发路径 {#meaning}
contrib/file_fdw/file_fdw.c 的校验器检查 ForeignTableRelationId 的选项;两者都缺失时以 ERROR 报告 either filename or program is required for file_fdw foreign tables。条件名比这一实现更宽,其他包装器可能在规划、扫描或修改阶段需要不同参数并产生不同报文。
报文与诊断 {#messages}
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。这些都是本地选项校验错误,不表示远端程序启动失败。
诊断 {#diagnosis}
检查具体的 CREATE FOREIGN TABLE 或 ALTER FOREIGN TABLE ... OPTIONS 定义及包装器接受的选项名。对 file_fdw,确认有一个可用的源选项且服务器进程能访问其值;其他包装器应查其校验器或回调的参数契约。
处理 {#response}
按包装器要求补上正确拼写和权限的选项,或使用其支持的动态参数机制;随后重新校验。未改变 SQL 就重试不能生成缺失参数。
版本 {#versions}
目录从 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”,匹配报文时要看服务器版本;这里不声称具体的变更发布版本。
相关 {#related}
HV00D 是包装器不认识选项名;HV000 是通用包装器失败;HV005 是外部列缺失而非 FDW 选项缺失。
来源 {#sources}
errcodes.txt— 定义,SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba。file_fdw.c— 校验条件与报文。- 9.1.24 历史
file_fdw.c— 固定的 filename-only 校验报文,SHA-2566f948ed8f9ffa6d1077b289f23c53eff02c5182492f0827b908c2be86026dad8。 - 结构化证据 — 源码路径与历史报文边界。
比较版本
SQLSTATE 证据与已记录的运行版本
claims · identity
{
"claim_id": "identity",
"limits": "",
"method": "Read the fixed definition row.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "HV002 is fdw_dynamic_parameter_value_needed in Class HV."
}claims · file-fdw-validator
{
"claim_id": "file-fdw-validator",
"limits": "This is one bundled implementation; other wrappers can use the condition for different required parameters.",
"method": "Read file_fdw.c:345-350.",
"position": 1,
"runtime": [],
"sources": [
"src.file_fdw.18.6"
],
"statement": "file_fdw raises HV002 when neither filename nor program is supplied for a foreign table."
}claims · historical-message
{
"claim_id": "historical-message",
"limits": "These are two fixed wrapper snapshots; this does not claim the exact transition release or behavior of other wrappers.",
"method": "Read both fixed wrapper source files and compare the validator report templates.",
"position": 2,
"runtime": [],
"sources": [
"src.file_fdw.18.6",
"src.file_fdw.9.1.24"
],
"statement": "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."
}messages · file-fdw-required-source
{
"limits": "",
"message_id": "file-fdw-required-source",
"path": "contrib/file_fdw/file_fdw.c:349-350",
"position": 0,
"raw": {
"id": "file-fdw-required-source",
"message": "either filename or program is required for file_fdw foreign tables",
"path": "contrib/file_fdw/file_fdw.c:349-350",
"severity": "ERROR",
"source_ids": [
"src.file_fdw.18.6"
],
"sqlstate": "HV002"
},
"severity": "ERROR",
"sources": [
"src.file_fdw.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "either filename or program is required for file_fdw foreign tables",
"position": 0,
"role": "observed",
"template": "either filename or program is required for file_fdw foreign tables"
}
]
}messages · file-fdw-required-source-9.1.24
{
"limits": "",
"message_id": "file-fdw-required-source-9.1.24",
"path": "contrib/file_fdw/file_fdw.c:222-224",
"position": 1,
"raw": {
"id": "file-fdw-required-source-9.1.24",
"message": "filename is required for file_fdw foreign tables",
"path": "contrib/file_fdw/file_fdw.c:222-224",
"severity": "ERROR",
"source_ids": [
"src.file_fdw.9.1.24"
],
"sqlstate": "HV002"
},
"severity": "ERROR",
"sources": [
"src.file_fdw.9.1.24"
],
"templates": [
{
"kind": "primary",
"literal": "filename is required for file_fdw foreign tables",
"position": 0,
"role": "observed",
"template": "filename is required for file_fdw foreign tables"
}
]
}sources · src.errcodes.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/errcodes.txt",
"position": 0,
"sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
"source_id": "src.errcodes.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}sources · src.file_fdw.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/file_fdw/file_fdw.c",
"position": 1,
"sha256": "d79ec21c08be6a806b0710aab09698678ddb24103d3470702e66ee1523432125",
"source_id": "src.file_fdw.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/file_fdw/file_fdw.c"
}sources · src.file_fdw.9.1.24
{
"commit": "e85493559c4678f54d30b6b4e04b17c03a3192d7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/file_fdw/file_fdw.c",
"position": 2,
"sha256": "6f948ed8f9ffa6d1077b289f23c53eff02c5182492f0827b908c2be86026dad8",
"source_id": "src.file_fdw.9.1.24",
"tag": "REL9_1_24",
"url": "https://github.com/postgres/postgres/blob/e85493559c4678f54d30b6b4e04b17c03a3192d7/contrib/file_fdw/file_fdw.c"
}sources · src.calls.REL_18_6
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_18_6.jsonl",
"position": 3,
"sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
"source_id": "src.calls.REL_18_6",
"tag": "",
"url": ""
}来源引用
定义来源
center · PostgreSQL 18 · english-manuals:4e55c5a45d462dead4b9190c6b60bc7c3232a6f1cc6fe10bda9f864f7c4f3056
正文语言: zh-Hans · english-manuals:4e55c5a45d462dead4b9190c6b60bc7c3232a6f1cc6fe10bda9f864f7c4f3056