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_column_number

SQLSTATE
HV008
Condition name
fdw_invalid_column_number
Class
Foreign Data Wrapper Error (SQL/MED)
Source macro
ERRCODE_FDW_INVALID_COLUMN_NUMBER
Evidence
Definition only
Analysis & operational context

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

<h1>HV008 — fdw_invalid_column_number</h1>

At a glance

HV008 identifies an invalid column number (ordinal) in an FDW descriptor or callback. PostgreSQL 18.6 defines it, but its core/contrib call scan found no direct report group or bundled message.

Meaning

The wrapper received or produced an ordinal that is outside the descriptor it is using. This is a mapping/descriptor issue, not evidence that a user SQL column name is absent (HV005) or malformed (HV007).

Messages and diagnostics

No fixed core message is confirmed. Keep the ordinal, descriptor width, local relation identity, callback phase, and wrapper/remote metadata version.

Diagnosis

Compare the target list and pg_attribute.attnum values with the wrapper's remote column array. Check dropped columns, projection rewrites, and schema changes between planning and execution. Read the installed wrapper source for the callback that indexes the descriptor.

Response

Refresh the foreign-table mapping or correct the wrapper's ordinal translation, then plan the statement again. Do not mask the error by dropping arbitrary columns; the correct repair depends on which descriptor boundary supplied the invalid ordinal.

Versions

HV008 is observed in every locked formal snapshot beginning at 9.1.0 through 18.6 and in 19 Beta 3. It was not observed in the available pre-9 definition files.

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.

HV008 is fdw_invalid_column_number in Class HV.

Method: Read the fixed definition row.

src.errcodes.18.6

No direct HV008 report group was resolved in the locked PostgreSQL 18.6 core/contrib call scan.

Method: Compare resolved report groups with the macro mapping.

Limits: Ordinal semantics are wrapper-specific. Generic API context and the absent resolved report group do not establish a source path emitting this SQLSTATE.

src.calls.REL_18_6 src.fdwapi.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:37858e837ebef2eb8246b4a3c2f… · English manual source