“disk quota exceeded” appears when PostgreSQL cannot write to disk because the server, tablespace, or file-system quota is full.
The server’s disk, tablespace, or OS quota reached its limit, so PostgreSQL cannot create WAL files, temporary files, or extend tables. Any write action fails until space is freed.
Run SELECT pg_size_pretty(pg_database_size(current_database()));
to measure the whole database. For per-table detail, query pg_total_relation_size
and order by size.
SELECT relname AS table,
pg_size_pretty(pg_total_relation_size(relid)) AS total
FROM pg_catalog.pg_statio_user_tables
ORDER BY pg_total_relation_size(relid) DESC
LIMIT 10;
This highlights bloated or log-style tables that can be trimmed or vacuumed.
1. VACUUM (FULL) reclaims dead tuples.
2. DELETE or TRUNCATE archival data.
3. DROP unused indexes after verifying they are redundant.
4. Remove old WAL files with pg_archivecleanup
if archiving is enabled.
CREATE TABLESPACE fast_disk LOCATION '/mnt/ssd_ts';
ALTER TABLE Orders SET TABLESPACE fast_disk;
The command copies data files to the new location and frees space on the original volume.
• Monitor pg_database_size
and OS disk usage.
• Run regular AUTOVACUUM
and avoid disabling it.
• Partition log-like tables and drop old partitions automatically.
• Size WAL (max_wal_size
) and temp (temp_file_limit
) parameters to fit budgets.
Yes. TRUNCATE rewrites the table, returning space to the file system instantly and faster than DELETE when you can remove all rows.
VACUUM FULL obtains an exclusive lock and rewrites the table, blocking other writes. Schedule it during low-traffic windows or use CLUSTER on a replica.
No. Changing max_wal_size
or min_wal_size
requires a postgresql.conf edit and a server reload, but not a full restart.