Skip to content

HV005 — fdw_column_name_not_found

PostgreSQL SQLSTATE HV005 denotes a foreign column name that the FDW cannot find. Check the wrapper’s remote descriptor and name mapping.

HV005 — fdw_column_name_not_found

At a glance

HV005 is the SQL/MED condition for a foreign column name that the wrapper cannot find in the relevant remote or imported descriptor. No direct HV005 report group was resolved in the PostgreSQL 18.6 core/contrib scan, so the concrete remote system and message remain wrapper-specific.

Field Value
SQLSTATE HV005
Condition fdw_column_name_not_found
Status active
Known present by 9.1.0
Locked snapshots 9.1.24, 9.2.24, 9.3.25, 9.4.26, 9.5.25, 9.6.24, 10.23, 11.22, 12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3
Macros ERRCODE_FDW_COLUMN_NAME_NOT_FOUND
Aliases

Meaning and scope

This code concerns name lookup at an FDW boundary: an imported or planned column name is absent from the descriptor the wrapper is using. It is narrower than a missing foreign table and different from a local 42703 undefined column.

Messages and diagnostics

No fixed core message is available. Preserve the exact name, case-folding/quoting context, foreign table or remote relation, wrapper version, and whether the failure occurred during import, planning, scan, or modification.

Diagnosis

Compare pg_attribute for the foreign table with the wrapper’s remote metadata and name-translation rules. Re-run schema discovery or inspect the wrapper’s import mapping where applicable. Do not infer a remote column simply from the local target list.

Response

Correct the foreign-table column definition or the wrapper’s name mapping, then refresh the remote schema metadata as its documentation requires. Retry after the descriptor agrees; changing transaction retry policy cannot create a missing column.

Versions

HV005 is observed from 9.1.0 through 18.6 and the 19 Beta 3 preview. Pre-9 definition files in the locked scan did not contain it, so the precise introduction is unknown.

HV007 concerns an invalid column name supplied to a descriptor API; HV008 concerns an invalid ordinal. 42703 is PostgreSQL’s local undefined-column condition.

Sources