Hot physical backup is an important capability for databases.
Physical backup allows us to get a completely consistent view of the changes to all databases at once. Physical backup also allows us to back up even while DDL changes are being executed on the database. Apart from resource constraints, there is no additional overhead or locking with this approach.
Physical backup procedures used to be slightly more complex than logical backup procedures, but in version 10, some defaults have been changed, making them easier; after these changes, making a backup with pg_basebackup
has become very easy, even with default settings.
As specified in the introduction to this chapter, making a backup with pg_basebackup
is covered in Chapter 12, Replication and Upgrades, and in this chapter, we will focus on the variant of the filesystem backup that uses pg_start_backup()
and pg_stop_backup()
, which is the only way to overcome some of the limitations of pg_basebackup...