strxfrm(), in locale “…”, writes past the specified array length

SQLSTATE 58000 condition system_error class 58 — System Error (errors external to PostgreSQL itself) severity ERROR
Reproduced & verified on PostgreSQL 14.23, 15.18, 16.14, 17.10 and 18.4 — identical message on every version.
Last reviewed 7 Jun 2026 · Reproduced live with the SQL on this page.

Symptoms

A statement failed with SQLSTATE 58000 (system_error), reported at severity ERROR. This is a System Error (errors external to PostgreSQL itself) condition: PostgreSQL emits the message strxfrm(), in locale "…", writes past the specified array length.

What the server log shows

ERROR:  strxfrm(), in locale "…", writes past the specified array length
HINT:  Apply system library package updates.

Why PostgreSQL raises this

Class 58 (System Error) reports failures external to PostgreSQL itself — operating-system level I/O, file, or similar errors surfaced through the server.

As described in PostgreSQL’s Appendix A PostgreSQL Error Codes, SQLSTATE 58000 carries the condition name system_error in class System Error (errors external to PostgreSQL itself). (Paraphrased — see the linked reference for the exact wording.)

Common causes

How to fix it

  1. Check OS logs, disk health, and filesystem permissions.
  2. Ensure the data directory is intact and writable.
  3. Address the underlying hardware/OS condition, then retry.

Version applicability

This message text is present in PostgreSQL 15.

Related & next steps

Reference: PostgreSQL Appendix A PostgreSQL Error Codes.