HV004
Read PG 18 manual ↗fdw_invalid_data_type
- SQLSTATE
- HV004
- Condition name
- fdw_invalid_data_type
- Class
- Foreign Data Wrapper Error (SQL/MED)
- Source macro
- ERRCODE_FDW_INVALID_DATA_TYPE
- Evidence
- Definition only
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
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
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
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
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
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
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.
Sources
errcodes.txt— definition, SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.FDW callback documentation— wrapper conversion/error contract.- Structured evidence — bounded scan and source boundary.
Source evidence
Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.
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.
Method: Read callback contract and compare resolved call groups.
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.
- src/backend/utils/errcodes.txt · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/include/foreign/fdwapi.h · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 raw/calls/REL_18_6.jsonl· ·
Message templates
No extracted message template is attached to this condition.
Reproduction & repair cases
No reproduction case is attached to this condition.
Recorded runtime evidence
No runtime observation is attached to this entry.
Version history 1
- PG 9.0 → 9.1added
Definition snapshot: english-manuals:4c7bc36e563a6b706aea12f4a34… · English manual source