Skip to content

22024 — unterminated_c_string

Source-backed reference for PostgreSQL SQLSTATE 22024.

22024

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.

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

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

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

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

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.

22025, 22019

Sources

The fixed catalogue definition is recorded in the structured evidence record. Its bounded-scan claim deliberately leaves the native emitter, primary text, severity, and transaction behavior unknown; no natural runtime was run.