At all times, PostgreSQL maintains a write ahead log (WAL) in the pg_wal/ subdirectory of the cluster's data directory. The log records every change made to the database's data files. This log exists primarily for crash-safety purposes: if the system crashes, the database can be restored to consistency by “replaying” the log entries made since the last checkpoint. However, the existence of the log
![26.3. Continuous Archiving and Point-in-Time Recovery (PITR)](https://cdn-ak-scissors.b.st-hatena.com/image/square/942c169a9546888ebd1837d63ba046041510086f/height=288;version=1;width=512/https%3A%2F%2Fwww.postgresql.org%2Fmedia%2Fimg%2Fabout%2Fpress%2Felephant.png)