Diagnostic Queries
Symptoms
PostgreSQL wrote fewer bytes than expected for a data block — a short write, often because the disk is full or failing. PostgreSQL raises SQLSTATE 58030 (io_error).
- A block write completed only partially.
- Often a full disk or failing storage.
- Risks data durability/consistency.
What the server log shows
ERROR: could not write block 12345 in file "base/16384/24576": wrote only 4096 of 8192 bytes
Why PostgreSQL raises this — what the manual says
As Section 28.6 WAL Internals explains:
A write of a specific block to the relation or WAL file failed, usually due to a full filesystem or an I/O error on the underlying device, leaving the page unable to be persisted.
Data files are written in fixed 8 KB pages. A short write (fewer bytes than a page) means the storage couldn’t accept the full block — usually a full or failing disk — so PostgreSQL reports 58030.
Common causes
- The filesystem is full (no space for the block).
- Failing disk/controller dropping writes.
- A quota or volume limit reached.
How to fix it
- Free or extend disk space urgently.
- Investigate storage/hardware health.
- Add disk-usage monitoring and alerts.
Related & next steps
Reference: PostgreSQL 18 Section 30.5 “WAL Internals”.
Thanks — noted. This helps keep the database accurate.