Exploring physical backups
A physical backup is a low-level backup that’s taken during the normal operations of the database cluster. Here, low-level means that the backup is somehow performed “externally” to the backup cluster – that is, at the filesystem level.
As you already know from Chapter 10, Users, Roles, and Database Security, the database cluster requires both the data files contained in PGDATA/base
and the WALs contained in PGDATA/wal
, as well as a few other files, to make the cluster work properly. The main concept, however, is that the data files and the WALs can make the cluster self-healing and recover from a crash. Hence, a physical backup performs a copy of all the cluster files and then, when the restore is required, it simulates a database crash and makes the cluster self-heal with the WALs in place.
The reason why physical backups are important is that they allow us to effectively clone a cluster, starting from the files it is...