Taking base backups

In the previous section, you saw that enabling archiving takes just a handful of lines and offers a great deal of flexibility. In this section, we will see how to create a so-called base backup, which can be used to apply XLOG later on. A base backup is an initial copy of data.


Keep in mind that the XLOG itself is more or less worthless. It is only useful in combination with the initial base backup.

In PostgreSQL, there are two main options to create an initial base backup:

  • Using pg_basebackup
  • Traditional methods based on copy /rsync

Note that pg_dump cannot be used for a base backup because a binary copy of the data is required. The pg_dump provides a textual representation of the data and not a binary one, so it is not feasible ...

Get PostgreSQL Replication - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.