# HV006 — fdw_invalid_data_type_descriptors

> PostgreSQL SQLSTATE HV006 denotes inconsistent or unusable FDW data-type descriptors. Inspect the wrapper metadata contract before changing SQL.
---

# HV006 — fdw_invalid_data_type_descriptors

## At a glance {#at-a-glance}

`HV006` covers invalid data-type descriptor information at an FDW boundary. PostgreSQL 18.6 defines it but the core/contrib call scan resolved no direct report group, so no bundled wrapper message or natural SQL reproduction is claimed.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `HV006` |
| Condition | `fdw_invalid_data_type_descriptors` |
| 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_INVALID_DATA_TYPE_DESCRIPTORS` |
| Aliases | `—` |

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

## Meaning {#meaning}

The condition is about the descriptor metadata itself: a wrapper's type OID, length, precision, typmod, or related descriptor fields can be inconsistent with the callback contract. It is distinct from a single value that fails conversion (`HV004`).

## Messages and diagnostics {#messages}

No fixed core message was found. Record descriptor field names and values, local and remote relation identities, callback phase, wrapper version, and any remote metadata response. Do not manufacture a message from the condition name.

## Diagnosis {#diagnosis}

Trace the descriptor from schema import/planning through tuple conversion. Inspect the wrapper source for the callback that builds or consumes it, then compare it with `fdwapi.h` and the wrapper's pinned documentation. A stale extension binary or changed remote schema is a more useful lead than a generic SQL retry.

## Response {#response}

Refresh or correct the wrapper's descriptor construction and align the foreign-table metadata with the remote schema. If the issue follows an extension upgrade, test the matching wrapper/server ABI. Retry only after the descriptor is corrected.

## Versions {#versions}

The code is present in all locked formal snapshots from 9.1.24 through 18.6 and in 19 Beta 3; the earliest locked definition is 9.1.0. No pre-9 definition observation is available.

## Related {#related}

[`HV004`](../hv004/) is a data-type mismatch; [`HV021`](../hv021/) concerns inconsistent descriptor information more generally; [`HV006`](../hv006/) focuses on data-type descriptor fields.

## Sources {#sources}

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