PostgreSQL: no space left on device
ERROR: could not write to file "<path>": No space left on deviceThe disk holding your data or WAL is full. Free space, expand the volume, or address bloat and stalled replication that retain data. If the WAL volume fills, Postgres can PANIC and stop.
What this error means
Postgres could not write because the filesystem is out of space. This may be the data directory, or, more dangerously, the WAL volume, whose exhaustion can crash the server.
Common causes are table and index bloat, runaway temp files, or a replication slot retaining WAL for a disconnected standby.
How to fix it
The volume is full
Free space or expand the disk, then check usage.
df -hBloat is consuming space
Vacuum bloated tables to reclaim space. VACUUM FULL needs free headroom to rewrite the table.
VACUUM (VERBOSE, ANALYZE) my_table;A replication slot retains WAL
A disconnected standby with an active slot keeps WAL forever. Drop the unused slot.
SELECT slot_name, active FROM pg_replication_slots;
SELECT pg_drop_replication_slot('unused_slot');How to avoid it next time
- Monitor disk usage and alert well before the volume fills.
- Cap temp_file_limit and watch replication slots for retained WAL.
Frequently asked questions
Why did Postgres PANIC and stop?
If the WAL volume fills, Postgres cannot guarantee durability and shuts down to protect data. Free WAL space, often by removing an unused replication slot.
How do I find what is using the space?
Start with df -h for the volume, then look at the largest tables and indexes, temp files, and the pg_wal directory size.
Stop struggling with SQL
Use FluentDB, the AI database client for macOS.
Related errors
Part of the PostgreSQL error reference. Last reviewed 2026-07-31.