select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SQLSTATE / CLASS HV · FOREIGN DATA WRAPPER ERROR (SQL/MED)

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
Analysis & operational context

English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗

<h1>HV004 — fdw_invalid_data_type</h1>

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

Source evidence

Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.

HV004 is fdw_invalid_data_type in Class HV.

Method: Read the fixed definition row.

src.errcodes.18.6

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.fdwapi.18.6 src.calls.REL_18_6

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
  1. PG 9.0 → 9.1added

Definition snapshot: english-manuals:4c7bc36e563a6b706aea12f4a34… · English manual source