# 01004 — string_data_right_truncation

> PostgreSQL SQLSTATE 01004 names a warning-category string truncation condition; the fixed core scan provides no emitting path.
---

# 01004 — string_data_right_truncation

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

`01004` names right truncation reported as a warning condition. No resolved 18.6 core/contrib report group was found, so this page does not assign a particular cast, encoding path, client, or message.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `01004` |
| Condition | `string_data_right_truncation` |
| Status | `active` |
| Known present by | `7.4` |
| Locked snapshots | `9.0.23, 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_WARNING_STRING_DATA_RIGHT_TRUNCATION` |
| Aliases | `—` |

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

## Meaning {#meaning}

The definition names right truncation as a warning condition. Without a resolved call group, the accepted truncation behavior, data preservation, and producer remain unknown.

## Messages and diagnostics {#messages}

No resolved 18.6 message variant was found. Preserve the exact value/column context, declared and received lengths when available, encoding, producer version, and complete diagnostics.

## Diagnosis {#diagnosis}

Locate the source that emitted the code and compare its length and encoding rules with the value being transferred. Distinguish a warning that preserves a truncated value from an error that rejects the statement; the SQLSTATE alone does not decide that behavior.

## Response {#response}

Use the producer's supported length or encoding adjustment and verify whether data was intentionally truncated. Do not silently retry the same input when information may already have been lost.

## Versions {#versions}

`01004` is present from the locked 9.0.23 snapshot through 18.6 and 19 Beta 3, with `known_present_by` 7.4. The available evidence establishes catalogue presence, not a current core emission path.

## Related {#related}

[`01003`](../01003/) concerns null elimination; [`01008`](../01008/) concerns zero-bit padding; [`22001`](../22001/) is a separate error-category string truncation condition.

## Sources {#sources}

- [`errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L90) — definition, SHA-256 `6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba`.
- [Structured evidence](../data/evidence/01004.json) — fixed sources, message groups, and runtime boundary.
