PostgreSQL’s Write-Ahead Log (WAL) is its transaction log: a sequential record of changes written before the corresponding data pages. It preserves data integrity, but it is also a hard operational dependency. If the volume holding WAL fills, PostgreSQL can no longer journal and commit changes; it may panic and shut down. section 5.5 section 7.1
Treat WAL capacity as part of the database’s write capacity, not as spare space for emergencies. A tempting response to a full data volume is to delete old rows, yet DELETE and TRUNCATE themselves generate WAL. MVCC can also leave dead rows requiring VACUUM, which marks reusable table space rather than necessarily returning it to the operating system. VACUUM FULL can release space, but rewrites the table under an ACCESS EXCLUSIVE lock. section 7.1
Avoid two costly WAL mistakes:
- Do not manually remove WAL files. The former pg_xlog directory, now pg_wal, contains essential transaction-log data; deleting it can make the installation unusable and require rebuilding the cluster from backup. section 7.1.1
- Do not allow replicated transactions to circulate unchecked. Logical replication streams WAL between nodes; bidirectional subscriptions without origin filtering can send transactions back and forth until extraneous WAL fills disks. section 5.5
- Do not monitor only table and index size. Track both disk usage and the number and total size of WAL files so retention or replication problems are visible before writes stop. section 7.4
Replication loop that consumes WAL
Two hosts can publish and subscribe to each other, but a transaction received from one host must not be republished back to its origin. Configure origin filtering, such as origin=NONE for native logical replication or forward_origins='{}' for pglogical, to prevent WAL messages from ping-ponging across the cluster. section 5.5
ERROR: could not extend file "base/12609/16048": No space left on device HINT: Check free disk space.
A “could not extend file” error identifies immediate data-volume exhaustion. Check WAL placement too: exhaustion on its volume blocks journaling and commits, making the incident more severe. section 7.1





