# 22024 — unterminated_c_string

> Source-backed reference for PostgreSQL SQLSTATE 22024.
---

# 22024

## At a glance {#at-a-glance}
The catalogue condition names a C-style string that ended before its required terminator. The bounded PostgreSQL 18.6 source review confirms the definition but does not bind a native emitting report group.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `22024` |
| Condition | `unterminated_c_string` |
| 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_UNTERMINATED_C_STRING` |
| Aliases | `—` |

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

## Meaning {#meaning}
22024 describes an unterminated C-style string or escape sequence at the interface/parser layer, but the fixed source scope here does not identify which PostgreSQL component emits it. The condition name alone is insufficient to assign a SQL text, ECPG, client, primary message, or recovery path.

## Diagnosis {#diagnosis}
Use the complete diagnostic and the parser or interface that produced it. Check where the quoted string or escape token should terminate and preserve the original input; do not infer that a client truncation or an arbitrary SQL quote problem necessarily maps to 22024.

## Response {#response}
Terminate or re-encode the string at the owning parser boundary and follow that layer’s documented recovery. Because no emitter was resolved in this bounded review, transaction and severity behavior remain unknown here.

## Versions {#versions}
The locked catalogue records this condition from 7.4; only the PostgreSQL 18.6 definition and bounded source scope are confirmed. No natural runtime observation is claimed for this page.

## Related {#related}
[`22025`](../22025/), [`22019`](../22019/)

## Sources {#sources}
The fixed catalogue definition is recorded in the structured [evidence record](../data/evidence/22024.json). Its bounded-scan claim deliberately leaves the native emitter, primary text, severity, and transaction behavior unknown; no natural runtime was run.
