# HV00C — fdw_invalid_option_index

> PostgreSQL SQLSTATE HV00C identifies an invalid FDW option index. Confirm the wrapper's option array and index contract before changing server options.
---

# HV00C — fdw_invalid_option_index

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

`HV00C` identifies an option index that is invalid for the FDW option collection in use. No direct `HV00C` report group was resolved in the PostgreSQL 18.6 core/contrib scan, so no specific option array or message is attributed.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `HV00C` |
| Condition | `fdw_invalid_option_index` |
| 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_OPTION_INDEX` |
| Aliases | `—` |

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

## Meaning {#meaning}

This condition concerns an ordinal into a wrapper's option representation. It is different from [`HV00D`](../hv00d/), where the option name is rejected, and from [`HV00J`](../hv00j/), whose name says the option was not found in dblink's option set.

## Messages and diagnostics {#messages}

No fixed 18.6 message is confirmed. Preserve the option index, option scope (wrapper/server/table/user mapping), wrapper version, and callback or validation phase.

## Diagnosis {#diagnosis}

Read the installed wrapper's option enumeration and the code that consumes the index. Check stale cached metadata, an extension/server ABI mismatch, and whether an option list was reordered between planning and execution. Do not treat a SQL option spelling error as an index error without the wrapper source.

## Response {#response}

Refresh or rebuild the wrapper-owned option list and use the option API expected by that wrapper. Correct a stale extension or mapping before retrying; changing an unrelated FDW option does not repair an invalid index.

## Versions {#versions}

The catalogue observes `HV00C` from 9.1.0 through 18.6 and in 19 Beta 3. It was not observed in the available pre-9 definition files.

## Related {#related}

[`HV00D`](../hv00d/) is an invalid option name; [`HV00J`](../hv00j/) is dblink's option-name-not-found condition; [`HV008`](../hv008/) is an invalid foreign-column number.

## Sources {#sources}

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