In the previous sections, you have seen how to interact with explicit transactions, and most notably how PostgreSQL executes every single statement within a transaction.
PostgreSQL goes to a lot of effort internally to ensure that consolidated data on storage reflects the status of the committed transactions. In other words, data can be considered consolidated only if the transaction that produced (or modified) it has been committed. But this also means that, once a transaction has been committed, its data is "safe" on storage, no matter what happens in the future.
PostgreSQL manages transactions and data consolidations by means of Write-Ahead Logs (WALs). This section introduces you to the concept of WALs and their use within PostgreSQL.
Write-Ahead Logs (WALs)
Before we dig into the details, it is required to briefly explain how PostgreSQL internally handles data. Tuples are stored in mass storage – usually, a...