# HV00K — fdw_reply_handle

> PostgreSQL SQLSTATE HV00K identifies an FDW reply-handle condition. The reply lifecycle and operation phase must be read from the installed wrapper.
---

# HV00K — fdw_reply_handle

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

`HV00K` is the SQL/MED reply-handle condition. PostgreSQL 18.6 defines it, but the locked core/contrib scan has no direct resolved `HV00K` report group; the condition does not by itself say whether a reply handle is missing, stale, or otherwise unusable.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `HV00K` |
| Condition | `fdw_reply_handle` |
| 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_REPLY_HANDLE` |
| Aliases | `—` |

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

## Meaning {#meaning}

An FDW that executes asynchronously or in stages may keep a handle for a remote reply. The API definition does not prescribe the handle representation or a universal state machine. Do not equate this condition with [`HV00B`](../hv00b/) unless the wrapper's source identifies the same object.

## Messages and diagnostics {#messages}

No fixed 18.6 message is confirmed. Preserve the reply/operation identity, callback phase, remote request status, wrapper version, and all protocol fields.

## Diagnosis {#diagnosis}

Locate the wrapper's request submission and reply-consumption code. Check whether the handle was consumed twice, released early, or used after a remote cancellation/disconnect. The source scan does not establish behavior for external wrappers.

## Response {#response}

Follow the wrapper's reply lifecycle and recreate the remote request only when its API says that is safe. For writes, establish completion from the remote system before repeating a request; `HV00K` alone is not a retry guarantee.

## Versions {#versions}

`HV00K` is observed from 9.1.0 through 18.6 and 19 Beta 3; pre-9 definition files did not contain it. No exact implementation introduction is claimed.

## Related {#related}

[`HV00B`](../hv00b/) is a generic invalid handle; [`HV00L`](../hv00l/) concerns creating an execution object; [`HV00M`](../hv00m/) concerns creating a reply object.

## Sources {#sources}

- [`errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L480) — 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/hv00k.json) — bounded source scan.
