22024
PostgreSQLERRORNotableData ExceptionHIGH confidence
unterminated C string
What this means
SQLSTATE 22024 is raised when a C-style string (null-terminated) passed to a low-level Postgres function does not have a proper null terminator. This is typically a bug in a C extension or driver.
Why it happens
- 1A C extension or low-level driver passes a non-null-terminated string to a Postgres function expecting a C string
How to reproduce
Buggy C extension passing unterminated string data.
expected output
ERROR: unterminated C string
Fix
Fix the C extension to properly null-terminate strings
WHEN When developing or debugging a Postgres C extension.
Why this works
In C extension code, ensure all strings passed to Postgres functions via palloc or cstring operations are properly null-terminated.
Sources
Official documentation ↗
Class 22 — Data Exception
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev