select open change scope Open full search

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

SQLSTATE / CLASS HV · FOREIGN DATA WRAPPER ERROR (SQL/MED)

fdw_invalid_handle

SQLSTATE
HV00B
Condition name
fdw_invalid_handle
Class
Foreign Data Wrapper Error (SQL/MED)
Source macro
ERRCODE_FDW_INVALID_HANDLE
Evidence
Definition only
Analysis & operational context

English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗

<h1>HV00B — fdw_invalid_handle</h1>

At a glance

HV00B names an invalid FDW handle: a wrapper received a handle that is unknown, closed, or invalid for the current operation. The PostgreSQL 18.6 core/contrib call scan has no resolved direct HV00B report group, so the handle type and message are implementation-specific.

Meaning

SQL/MED uses “handle” for an implementation-owned reference, not a PostgreSQL relation OID or a SQL transaction ID. A wrapper might use one for a remote connection, cursor, reply, or execution object; these are possible examples, not an established emitter path in this batch. The class definition alone does not identify which one.

Messages and diagnostics

No direct 18.6 core/contrib message variant was resolved. Record the wrapper name/version, handle kind and lifetime, callback phase, foreign server/table, and the complete diagnostic. A remote server's connection failure may be a different SQLSTATE.

Diagnosis

Trace creation, transfer, reuse, and close of the handle in the wrapper source. Check whether a scan or modification callback outlived a connection, whether a callback ran after cleanup, and whether the wrapper's ABI matches the server. Do not infer that a NULL SQL value is an invalid handle.

Response

Repair the wrapper's handle lifecycle or recreate the wrapper-owned connection/object according to its API. If the wrapper cannot establish whether a write completed, inspect remote logs before repeating it. An unchanged request is unlikely to repair a stale or closed handle.

Versions

HV00B is present from 9.1.0 through 18.6 and in 19 Beta 3. The available pre-9 definition scan did not observe it; this is a history boundary, not an exact introduction claim.

Sources

Source evidence

Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.

HV00B is fdw_invalid_handle in SQL/MED Class HV.

Method: Read the fixed definition row and macro.

src.errcodes.18.6

No direct HV00B report group was resolved in the locked PostgreSQL 18.6 core/contrib call scan.

Method: Compare resolved report groups with the macro mapping.

Limits: The generic FDW API boundary does not identify an emitter for this SQLSTATE. The scan does not cover external wrappers, drivers, remote systems, or user callbacks.

src.calls.REL_18_6 src.fdwapi.18.6

Message templates

No extracted message template is attached to this condition.

Reproduction & repair cases

No reproduction case is attached to this condition.

Recorded runtime evidence

No runtime observation is attached to this entry.

Version history 1
  1. PG 9.0 → 9.1added

Definition snapshot: english-manuals:44b7f7fc1d075552b9478ce6e84… · English manual source