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_use_of_null_pointer

SQLSTATE
HV009
Condition name
fdw_invalid_use_of_null_pointer
Class
Foreign Data Wrapper Error (SQL/MED)
Source macro
ERRCODE_FDW_INVALID_USE_OF_NULL_POINTER
Evidence
Definition only
Analysis & operational context

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

<h1>HV009 — fdw_invalid_use_of_null_pointer</h1>

At a glance

HV009 describes an invalid null-pointer use at the FDW boundary. The PostgreSQL 18.6 core/contrib scan found no direct resolved report group, so no safe SQL reproduction or bundled message is claimed.

Meaning

The condition is intended for a wrapper/API contract violation involving a null pointer, such as an absent descriptor, handle, or callback result that the wrapper treats as present. It is not a generic SQL NULL value error and cannot be inferred from a nullable column.

Messages and diagnostics

No fixed core message variant was found. Preserve the pointer-owning callback, handle/descriptor identity, wrapper build, and full server log. A crash, XX000, or a driver exception may occur instead depending on the implementation.

Diagnosis

Treat this as a wrapper defect or contract mismatch until source proves otherwise. Inspect the callback implementation and ABI/API version, then check whether a remote disconnect or failed allocation created the null state. Do not dereference or “repair” the object from SQL.

Response

Stop retrying the same operation while the wrapper defect is present. Preserve logs and isolate the foreign server/table, then upgrade or patch the wrapper after reproducing in a disposable environment. If the process or connection terminated, follow that component's recovery procedure.

Versions

The condition is observed from 9.1.0 through 18.6 and the 19 Beta 3 preview; pre-9 definition scans did not observe it. No implementation introduction version is claimed.

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.

HV009 is fdw_invalid_use_of_null_pointer in Class HV.

Method: Read the fixed definition row.

src.errcodes.18.6

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

Method: Compare resolved report groups with the macro mapping.

Limits: A wrapper may terminate the connection or process instead of returning this code. Generic API context and the absent resolved report group do not establish a source path emitting this SQLSTATE.

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:67294f17c9088907f187d5c0692… · English manual source