could not open critical system index n

SQLSTATE XX001 condition data_corrupted class XX — Internal Error severity PANIC
Reproduced & verified on PostgreSQL 14.23, 15.18, 16.14, 17.10 and 18.4 — identical message on every version.
Last reviewed 26 May 2026 · Reproduced live with the SQL on this page.

Symptoms

A statement failed with SQLSTATE XX001 (data_corrupted), reported at severity PANIC. This is a Internal Error condition: PostgreSQL emits the message could not open critical system index n.

What the server log shows

PANIC:  could not open critical system index n

Why PostgreSQL raises this

Class XX (Internal Error) indicates a condition that should not normally occur — often a sign of data corruption or a server bug. These warrant careful investigation.

As described in PostgreSQL’s Chapter 30 Reliability and the Write-Ahead Log and Appendix A (PostgreSQL Error Codes), SQLSTATE XX001 carries the condition name data_corrupted in class Internal Error. (Paraphrased — see the linked reference for the exact wording.)

Common causes

How to fix it

  1. Capture the full message, context, and server version.
  2. Check storage/hardware and recent crash history.
  3. Take a backup and consider reporting a reproducible case upstream.

Version applicability

This message is present in PostgreSQL 15, 16, 17, 18 and 19.

Related & next steps

Reference: PostgreSQL Chapter 30 Reliability and the Write-Ahead Log.