HV004 — fdw_invalid_data_type
HV004 is the SQL/MED condition for a foreign-data-wrapper data type that cannot be used for the requested operation. The 18.6 core/contrib call scan found no resolved direct HV004 report group, so this page does not claim a particular bundled message or SQL trigger.
English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- aliases
- Unknown
- class name
- Foreign Data Wrapper Error (SQL/MED)
- condition name
- fdw_invalid_data_type
- lang
- en
- sqlstate
- HV004
Definition PG 18
HV004 — fdw_invalid_data_type
At a glance {#at-a-glance}
HV004 is the SQL/MED condition for a foreign-data-wrapper data type that cannot be used for the requested operation. The 18.6 core/contrib call scan found no resolved direct HV004 report group, so this page does not claim a particular bundled message or SQL trigger.
Meaning and scope {#meaning}
The condition belongs to the FDW callback boundary: a wrapper may reject a local column type, a remote type mapping, or a value conversion. PostgreSQL's FDW documentation notes that a wrapper may raise an error for a data-type mismatch; it does not prescribe one universal mapping or message.
Messages and diagnostics {#messages}
No fixed 18.6 message variant was resolved for this code. Keep the wrapper's M, D, H, source file/function, local column type, remote type, and operation. A remote server's type error must remain distinguishable from the wrapper's local SQLSTATE.
Diagnosis {#diagnosis}
Identify the foreign table column and conversion direction, then inspect the wrapper's validator, deparser, and tuple conversion code at its pinned version. Compare the local catalog type, collation/typmod where relevant, and the remote type metadata. A generic cast failure or 22xxx value error is not evidence for HV004.
Response {#response}
Use a supported type mapping or alter the foreign-table definition after checking data compatibility. If conversion is implemented by an external wrapper, upgrade or configure that wrapper only after checking its compatibility contract. Do not retry an unchanged plan; a data-type mismatch is deterministic for the same metadata.
Versions {#versions}
The catalogue observes HV004 from 9.1.0 through 18.6 and 19 Beta 3. The available pre-9 definition scan did not observe it; no exact introduction version is claimed.
Related {#related}
Compare HV006 for inconsistent type descriptors and HV007 for an invalid column name. 42804 is a core datatype mismatch and has a different ownership boundary.
Sources {#sources}
errcodes.txt— definition, SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.FDW callback documentation— wrapper conversion/error contract.- Structured evidence — bounded scan and source boundary.
Compare versions
SQLSTATE evidence and recorded runtime versions
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": ""
}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · english-manuals:c9671a993e3439ae7f8d33c3c43e5f391afa2629dc2e690499e205ce7136fba0
Text language: en · english-manuals:c9671a993e3439ae7f8d33c3c43e5f391afa2629dc2e690499e205ce7136fba0