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:
- Check OS/system logs and SMART data for disk failures.
- Verify filesystem health and data-directory permissions.
- 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?
Thanks — noted. This helps keep the database accurate.