PostgreSQL also has the ability to restore the database to any point in history following the previous backup. This is called point in time recovery (PITR). It does this by keeping files called transaction logs. So long as we store these transaction logs, we can use them to restore to any date they contain.
Please refer to the Getting a basic export (Simple) recipe to bootstrap our database. Before we start the database to create the
sample database, we need to change a couple of settings in
postgresql.conf. For this, we will need a path in
/archive to store transaction logs, which can be used by the following configuration settings:
wal_level = archive archive_mode = on archive_command = 'test ...