# HV00D — fdw_invalid_option_name

> PostgreSQL SQLSTATE HV00D reports an option name that the FDW implementation does not accept. file_fdw and postgres_fdw provide concrete validation messages and hints.
---

# HV00D — fdw_invalid_option_name

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

`HV00D` is raised when an FDW option name is not valid in the current wrapper context. PostgreSQL 18.6 has direct paths in `file_fdw`, `postgres_fdw`, and the `postgres_fdw` import option parser.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `HV00D` |
| Condition | `fdw_invalid_option_name` |
| 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_NAME` |
| Aliases | `—` |

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

## Meaning and messages {#meaning}

The option is checked against the wrapper's valid options for its context: FDW, server, foreign table, user mapping, or import. The 18.6 primary template is `invalid option "%s"`. `file_fdw` and `postgres_fdw/option.c` add `Perhaps you meant the option "%s".` only when a close match exists; if valid options exist but no close match is found, the source emits no hint, and `There are no valid options in this context.` is used only when no valid option exists. The `postgres_fdw` import parser has only the primary message.

## Diagnosis {#diagnosis}

Record the object being altered and the wrapper version, then read that wrapper's validator and option list. Check whether an option belongs on the foreign server, foreign table, or user mapping; identical names can be valid in one scope and invalid in another. Preserve the hint's close match instead of guessing from a different wrapper.

## Response {#response}

Use the option name and scope accepted by the installed wrapper, or remove the unsupported option. If the option was introduced by a newer extension, align the extension and server versions after confirming that is the cause. Retrying the same definition cannot change validation.

## Messages and diagnostics {#messages}

The fixed 18.6 call groups are `file_fdw/file_fdw.c:248-253`, `postgres_fdw/option.c:110-116`, and `postgres_fdw/postgres_fdw.c:5491-5493`; all are `ERROR`. Their `%s` values are dynamic option names and close matches.

## Versions {#versions}

`HV00D` is present from 9.1.0 through 18.6 and 19 Beta 3. A fixed REL9_6_24 snapshot of the file_fdw and postgres_fdw validators uses the older `Valid options in this context are: %s` hint, while the fixed 18.6 paths use the closest-match/no-valid-options branches. These two snapshots bound the wording; they do not establish the exact transition release, so match the installed version when comparing logs.

## Related {#related}

[`HV00C`](../hv00c/) concerns an option index, [`HV00J`](../hv00j/) is dblink's option-name-not-found code, and [`HV00A`](../hv00a/) concerns string format rather than option identity.

## Sources {#sources}

- [`errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L472) — definition, SHA-256 `6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba`.
- [file_fdw.c](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/file_fdw/file_fdw.c#L244-L253), [postgres_fdw/option.c](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/postgres_fdw/option.c#L107-L116), [postgres_fdw.c](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/postgres_fdw/postgres_fdw.c#L5488-L5493) — 18.6 validators.
- [file_fdw.c in REL9_6_24](https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/contrib/file_fdw/file_fdw.c#L240-L246) and [postgres_fdw/option.c in REL9_6_24](https://github.com/postgres/postgres/blob/a4116b8d5a4f68803452d8f1aa3f74f302049a90/contrib/postgres_fdw/option.c#L99-L103) — bounded historical hint comparison; SHA-256 1745225d449f44e9b384e372e8e13d5f5fe141e53d49526760fc1df8a1bf6211 and d7da1cf22cd61619ef2f0cb7ce1a741d4ecb9a03636766e097e2183acdf21d48.
- [Structured evidence](../data/evidence/hv00d.json) — exact message roles and source hashes.
