SQLSTATE 58030 ERROR Class 58: System Error

io_error Io Error — SQLSTATE 58030

An operating-system I/O error occurred.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Symptoms

An operating-system I/O error occurred.

  • The error is written to the server log and returned to the client carrying SQLSTATE 58030.
  • Any driver (libpq, JDBC, psycopg, npgsql, pgx) surfaces this code in its error object so you can branch on it programmatically.
  • PL/pgSQL can trap it by name: EXCEPTION WHEN io_error THEN.

Environment

Severity: ERROR  |  PostgreSQL versions: 12, 13, 14, 15, 16, 17

Indicates a system- or storage-level problem; inspect OS logs, disk health, and any recent hardware or filesystem changes.

Root Cause

The OS reported a failure reading or writing a file PostgreSQL needs.

Common causes:

  • A failing disk.
  • Filesystem corruption.
  • Changed permissions.
  • A file removed out from under PostgreSQL.

Diagnostic Queries

Recovery

Steps to resolve 58030:

  1. Check OS/system logs and SMART data for disk failures.
  2. Verify filesystem health and data-directory permissions.
  3. Restore from backup if files are damaged; do not keep running on failing hardware.

Reference: PostgreSQL error codes — Class 58 (System Error).

Was this helpful?