SQLSTATE 58030 ERROR Class 58: System Error

io_error could not read block N in file “…” — 58030

PostgreSQL error “could not read block N in file … — 58030” (SQLSTATE 58030): what it means, common causes, and how to fix it.

PG 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

Diagnostic Queries

Symptoms

PostgreSQL read fewer bytes than expected for a data block, indicating a truncated/short read. PostgreSQL raises SQLSTATE 58030 (io_error).

  • A block read returned fewer bytes than a full page.
  • Often a truncated file or failing storage.
  • Signals possible corruption or hardware trouble.

What the server log shows

ERROR:  could not read block 12345 in file "base/16384/24576": read only 0 of 8192 bytes

Why PostgreSQL raises this — what the manual says

As Section 28.6 WAL Internals explains:

A read of a specific data or WAL block failed, typically signalling underlying storage corruption or an I/O fault; the block could not be retrieved from the relation file at the expected offset.

Data files are read in fixed 8 KB pages. A short read (fewer bytes than a page) means the file is truncated or the storage failed, so PostgreSQL reports 58030.

Common causes

  • A truncated relation file (e.g. from a botched restore/copy).
  • Failing disk or filesystem returning short reads.
  • Out-of-band file tampering in the data directory.

How to fix it

  1. Investigate storage/filesystem health immediately.
  2. Restore the affected relation/database from a known-good backup.
  3. Never manually edit files in the data directory.

Related & next steps

Reference: PostgreSQL 18 Section 30.5 “WAL Internals”.

Was this helpful?