PostgreSQL 53100: disk full
The file system holding the data directory, WAL or temporary files is full. Writes fail until space is freed; a full WAL disk can stop the server.
- SQLSTATE
53100- Name
disk_full- Category
- Insufficient Resources
What it means
PostgreSQL got No space left on device from the operating system while growing a table or index file, writing temporary sort files, or writing WAL. The statement fails with 53100 (disk_full) and its transaction is rolled back.
If the WAL directory (pg_wal) fills up, the server can't write any changes and shuts down with a PANIC; it won't start again until space is freed. Never delete files from pg_wal by hand.
Common causes
- Data growth, or table and index bloat from heavy updates and deletes without enough vacuuming.
- WAL piling up because a replication slot is inactive, archiving (
archive_command) is failing, ormax_wal_size/wal_keep_sizeare large. - A large sort, hash or
CREATE INDEXwriting temporary files. - Server logs or other files on the same volume.
How to fix it
-
Find what is using the space.
SELECT pg_size_pretty(pg_database_size(current_database())); SELECT relname, pg_size_pretty(pg_total_relation_size(oid)) AS size FROM pg_class WHERE relkind = 'r' ORDER BY pg_total_relation_size(oid) DESC LIMIT 10;
-
Look for replication slots holding WAL back, and drop the ones no longer used.
SELECT slot_name, active, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) AS retained FROM pg_replication_slots; SELECT pg_drop_replication_slot('old_slot'); -
Check that WAL archiving succeeds.
SELECT archived_count, failed_count, last_failed_wal, last_failed_time FROM pg_stat_archiver;
-
Free or add disk space: grow the volume, remove unrelated files, or reclaim bloat with
VACUUM FULL(which needs room for a full copy of the table) orpg_repack. -
Limit temporary file use per session so one query can't fill the disk.
ALTER SYSTEM SET temp_file_limit = '20GB'; SELECT pg_reload_conf();
Related errors
53200out of memory57P01terminating connection due to administrator9002SQL Server: Transaction log for database is full1105SQL Server: Filegroup is full, cannot allocateORA-01653Oracle: unable to extend table in tablespaceSQLITE_FULLSQLite: database or disk is full1114MySQL: The table is full
More insufficient resources errors
The code and message text are from the PostgreSQL documentation, Appendix A: PostgreSQL Error Codes. Browse the full PostgreSQL error list or search every database error.
Work on PostgreSQL in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for PostgreSQL and the other databases you use.