Re: pg_basebackup + incremental base backups

Michael Paquier <[email protected]>
Newsgroups gmane.comp.db.postgresql.general
Message-ID <[email protected]>
On Fri, Nov 29, 2019 at 04:57:11PM -0300, Christopher Pereira wrote:
> Our stream replication slave server got out of sync so we need to base
> backup again.
> 
> In case of big databases, can we do incremental backups with pg_basebackup?

I know of two ways to define such backups, one being actually
incremental and the other differential:
- In the shape of a range of WAL segments, which is incremental.  A
full base backup is taken, and then by backing up periodically a range
of WAL segments to make sure that you are able to recover up to the
point you are looking for.  Postgres core can help to do that by
itself. 
- Using a combination of full backups and differential backups
(differential), the latter containing only (well, mostly) relation
pages which have changed since the last full backup or differential
backup.  When restoring, you then need to merge the last full backup
and one or more differential backups, followed by a replay of WAL
segments up to the point you are willing to recover to.  In this case
some external tools offer solutions to that problem: pgBackRest and
pg_rman are two I know of.

Other backup solutions on top of the two cited above, like barman, all
have implementations to handle the first type of incremental backup.

> Is there any alternative?
> 
> Here was a proposal: https://wiki.postgresql.org/wiki/Incremental_backup

Yeah, nothing has been done in uptream though in this area.  That's
more about differential backups.
--
Michael
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3h1TYACgkQnvQgOdby
QH1Gbw/8DlfA9T4DIYChvaOhpMGjZSZ/99tWRwb1xEpkiYkNP9tK0RzJ906CqbtC
hYJizmMvNAXa+Pz1HUvEKyBdvAUyuZISQyuMwrQs/YA683CLgcY136j8hqdjZK7n
c5sPkUCr4SCKMW3SAOhPjZARo4XETX2fjCvszwdBaQlbLmahmew0mqCtU04DulG9
Ey1flXqe5XNbQ8JMH/I7GH004xkxVUb2V913ubITh2id3mmwQ2+hYKPBE/cTONHj
OGzTUaandDOfDnPb9nusb3icN0hw+Q4fz4KrjaNXaavTLha3SxrvRJbVKXfIc7UK
PSlvdxRxO6q0DvnQTmwy5MM+QungLq+RowAa6ZKFYdzR8HQDRDmWTqjCyYAFPZ0i
alqmPoEL3pD6n3Oce6FEoULBPphBFKDXhEBy/m8I7WBUmDyZL7IB1Z/jza53ywCQ
cVevKz6BWs1skkbRAlEI/a+4h6WGEtU/9ZsGrqPcFpGWrqkc0A6YElGEWJn2m5Cy
O5JFLdHtDzY4BSuoVqonEl2QBSbK4BhNW9AGWCdqUs5jqFDi4pvCSDbM7l9D/2ek
KpxRv1rmZKKaVKO80EpVVwFOLN1CsTrTgmkvrlMUN+2uCiC95pqYGFHLLGIHutvq
IBtTIjQ2SJeSIKyYRTai2V6Ew+JqJes3Q0R+Cm+IL0w4zjrBuDE=
=O4Ge
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.