HV004 — fdw_invalid_data_type(外部数据包装器数据类型无效)
包装器无法使用该数据类型,类型映射不匹配。
英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 18·选择有来源记录的版本
- aliases
- 未知
- class name
- Foreign Data Wrapper Error (SQL/MED)
- condition name
- fdw_invalid_data_type
- lang
- en
- sqlstate
- HV004
版本定义 PG 18
HV004 — fdw_invalid_data_type
速览 {#at-a-glance}
HV004 表示 FDW 无法使用某个数据类型。18.6 核心及 contrib 调用扫描没有解析出直接报告组,因此不能指定自带包装器报文或自然 SQL 触发器。
含义 {#meaning}
包装器可能拒绝本地列类型、远端类型映射或值转换。FDW 文档说明,类型不匹配时可以报告错误,但没有规定统一映射或报文;不能把每个类型转换失败都归为此码。
报文与诊断 {#messages}
没有确认的 18.6 核心报文。保留 M/D/H、源码函数、操作阶段、本地列类型、远端类型和包装器版本;远端服务器的类型错误要和包装器本地 SQLSTATE 区分。
诊断 {#diagnosis}
确认列和转换方向,查看固定版本包装器的校验器、deparser 与元组转换代码,并比较本地目录类型、必要的 typmod/collation 和远端元数据。不要从通用 cast 或 22xxx 推断 HV004。
处理 {#response}
选择包装器支持的类型映射,或在确认数据兼容后修改外部表定义。若转换由外部扩展实现,应按兼容契约升级或配置;相同元数据下错误是确定性的,不能靠重试解决。
版本 {#versions}
目录从 9.1.0 观察到该码,延续到 18.6 与 19 Beta 3;pre-9 定义扫描未观察到它,精确引入版本未知。
相关 {#related}
HV006 是类型描述符不一致;HV007 是列名无效;42804 是核心类型不匹配,边界不同。
来源 {#sources}
errcodes.txt— 定义,SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba。FDW callback documentation— 类型转换和错误边界。- 结构化证据 — 有界扫描与来源边界。
比较版本
SQLSTATE 证据与已记录的运行版本
claims · identity
{
"claim_id": "identity",
"limits": "",
"method": "Read the fixed definition row.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "HV004 is fdw_invalid_data_type in Class HV."
}claims · fdw-boundary
{
"claim_id": "fdw-boundary",
"limits": "Concrete type mappings and messages belong to the installed wrapper. Generic API context and the absent resolved report group do not establish a source path emitting this SQLSTATE.",
"method": "Read callback contract and compare resolved call groups.",
"position": 1,
"runtime": [],
"sources": [
"src.fdwapi.18.6",
"src.calls.REL_18_6"
],
"statement": "The FDW callback contract permits a wrapper to raise an error for a data-type mismatch, but the locked 18.6 core/contrib scan has no direct HV004 report group."
}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.fdwapi.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/include/foreign/fdwapi.h",
"position": 1,
"sha256": "572ba892e6435ca92d3b3bc84dde5bbd3160cc3a082693daab8daa835c4d2cd7",
"source_id": "src.fdwapi.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/foreign/fdwapi.h"
}sources · src.calls.REL_18_6
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_18_6.jsonl",
"position": 2,
"sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
"source_id": "src.calls.REL_18_6",
"tag": "",
"url": ""
}来源引用
定义来源
center · PostgreSQL 18 · english-manuals:c9671a993e3439ae7f8d33c3c43e5f391afa2629dc2e690499e205ce7136fba0
正文语言: zh-Hans · english-manuals:c9671a993e3439ae7f8d33c3c43e5f391afa2629dc2e690499e205ce7136fba0