↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / SQLSTATE

HV008 — fdw_invalid_column_number

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.

English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

aliases
Unknown
class name
Foreign Data Wrapper Error (SQL/MED)
condition name
fdw_invalid_column_number
lang
en
sqlstate
HV008

Definition PG 18

HV008 — fdw_invalid_column_number

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

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

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

Related {#related}

HV005 concerns a missing name, HV007 an invalid name, and HV006 invalid type descriptor metadata.

Sources {#sources}

Compare versions

SQLSTATE evidence and recorded runtime versions

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read the fixed definition row.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "HV008 is fdw_invalid_column_number in Class HV."
}
claims · scan-boundary
{
  "claim_id": "scan-boundary",
  "limits": "Ordinal semantics are wrapper-specific. Generic API context and the absent resolved report group do not establish a source path emitting this SQLSTATE.",
  "method": "Compare resolved report groups with the macro mapping.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.calls.REL_18_6",
    "src.fdwapi.18.6"
  ],
  "statement": "No direct HV008 report group was resolved in the locked PostgreSQL 18.6 core/contrib call scan."
}
sources · src.errcodes.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}
sources · src.fdwapi.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/include/foreign/fdwapi.h",
  "position": 1,
  "sha256": "572ba892e6435ca92d3b3bc84dde5bbd3160cc3a082693daab8daa835c4d2cd7",
  "source_id": "src.fdwapi.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/foreign/fdwapi.h"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 2,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "",
  "url": ""
}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · english-manuals:6e999c7f19a51397e4de4e5d52c8aa1d7e92e21c0f3e2a8d92c3ba6300da60e4

Text language: en · english-manuals:6e999c7f19a51397e4de4e5d52c8aa1d7e92e21c0f3e2a8d92c3ba6300da60e4