# HV090 — fdw_invalid_string_length_or_buffer_length

> PostgreSQL SQLSTATE HV090 names an FDW string or buffer length condition; the buffer owner and valid bounds come from the actual wrapper or driver.
---

# HV090 — fdw_invalid_string_length_or_buffer_length

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

`HV090` identifies an invalid string length or buffer length at an FDW boundary. The locked 18.6 core/contrib call scan has no resolved `HV090` report group, so it does not establish a native buffer check or message.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `HV090` |
| Condition | `fdw_invalid_string_length_or_buffer_length` |
| 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_STRING_LENGTH_OR_BUFFER_LENGTH` |
| Aliases | `—` |

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

## Meaning {#meaning}

The condition can concern a string length, a destination buffer, or a wrapper-defined length field. The definition does not tell whether the invalid value was supplied by a remote response, a driver, or local wrapper code.

## Messages and diagnostics {#messages}

No resolved 18.6 core/contrib message variant was found. Preserve the complete diagnostic, length and buffer context if exposed, encoding or type context, callback phase, and wrapper/driver version.

## Diagnosis {#diagnosis}

Trace the wrapper's length validation and allocation boundary. Compare the value with the bounds and units used by that implementation, and distinguish bytes from characters only when the source or diagnostic supports it.

## Response {#response}

Correct the producer or option that supplies the invalid length, or use the wrapper's supported buffer/encoding path. Avoid truncating a value blindly; confirm the wrapper's contract and whether a remote request has already been sent.

## Versions {#versions}

`HV090` is present in the locked definition snapshots from 9.1.24 through 18.6 and 19 Beta 3, with `known_present_by` 9.1.0. The available pre-9 definition material does not establish an exact introduction release.

## Related {#related}

[`HV024`](../hv024/) concerns an invalid attribute value; [`HV00A`](../hv00a/) concerns invalid string format; [`HV091`](../hv091/) concerns a descriptor field identifier.

## Sources {#sources}

- [`errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L473) — definition, SHA-256 `6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba`.
- [`fdwapi.h`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/foreign/fdwapi.h#L24-L55) — generic FDW callback boundary.
- [Structured evidence](../data/evidence/hv090.json) — fixed 18.6 sources and bounded scan.
