22027 — trim_error
22027
At a glance
The trim operation rejected its argument or trim specification. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan.
| Field | Value |
|---|---|
| SQLSTATE | 22027 |
| Condition | trim_error |
| 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_TRIM_ERROR |
| Aliases | — |
Meaning
The locked definition names trim_error, but the bounded PostgreSQL 18.6 source review did not resolve a native emitter for 22027. This page therefore records the condition identity and diagnostic boundary without assigning a particular SQL trim function, whitespace rule, or primary message.
Diagnosis
If a deployment reports 22027, preserve the complete primary, DETAIL, and HINT together with the invoking function or extension. The condition name alone cannot tell whether the rejected input is the source string, trim set, direction, or a consumer-specific option; do not substitute a guessed whitespace rule.
Response
Use the actual emitter’s diagnostic to correct the trim input or operation. If the source is an extension or a version-specific path, check that implementation’s documented argument rules. If an ERROR occurred in an explicit transaction, roll back or roll back to the existing savepoint before retrying; autocommit can retry the corrected action.
Versions
The locked catalogue records this condition from 7.4. Only the PostgreSQL 18.6 definition row is fixed here; no native emitting path or natural runtime observation is claimed.
Related
Sources
The fixed definition row is src/backend/utils/errcodes.txt#L202. The bounded source review did not resolve a native 22027 emitter; the structured evidence record keeps that unknown scope explicit, and no natural runtime was run.