# 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 {#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.

<!-- BEGIN SQLSTATE FACTS: generated by scripts/generate.py; do not edit -->

| 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 | `—` |

<!-- source facts: data/errcodes/HV005.json -->
<!-- END SQLSTATE FACTS -->

## Meaning and scope {#meaning}

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 {#messages}

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 {#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 {#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 {#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.

## Related {#related}

[`HV007`](../hv007/) concerns an invalid column name supplied to a descriptor API; [`HV008`](../hv008/) concerns an invalid ordinal. [`42703`](../42703/) is PostgreSQL's local undefined-column condition.

## Sources {#sources}

- [`errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L460) — definition, SHA-256 `6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba`.
- [`FDW callback API`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/foreign/fdwapi.h#L24-L55) — descriptor-consuming callback boundary.
- [Structured evidence](../data/evidence/hv005.json) — bounded scan and source boundary.
