HV008
Read PG 18 manual ↗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
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
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
errcodes.txt— definition, SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.fdwapi.h— callback boundary.- 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.
HV008 is fdw_invalid_column_number in Class HV.
Method: Read the fixed definition row.
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/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:37858e837ebef2eb8246b4a3c2f… · English manual source