I have experiences of administration with MySQL and Oracle Database. I started to work with PostgreSQL recently and cannot find the reason why PostgreSQL managing WAL files by removing or adding according to setting with wal_keep_segments, max_wal_size and min_wal_size.

MySQL just keeps on generaing new transaction files and Oracle rotates the trancation files with REDO log files and also archiving. I don't know why PostgreSQL managing WAL by changing the number of WAL files. Why not just keep the fixed number of WAL files?

1 Answer 1


Postgres temporarily adds WAL segments beyond max_wal_size to absorb peak transaction loads without forcing a checkpoint -- unlike Oracle.

It removes unneeded WAL seqments to avoid using up the log file system unnecessarily.

There's always a trade-off between performance and resource (in this case log disk space) utilization, and different DBMSes use different approaches to addressing this issue. In this case PostgreSQL lets you find the balance that works best for you by allowing you to play with the values of wal_keep_segments, max_wal_size and min_wal_size.

  • Thanks you. I think I understand! maybe I need to study more about checkpoint stuff.
    – eger
    Commented Apr 28, 2018 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.