Skip to main content

PostgreSQL Introduces Incremental Backup Support in PostgreSQL 17

In a significant development for the PostgreSQL database server, incremental backup support has been successfully implemented and merged into the latest version, PostgreSQL 17. Spearheaded by Robert Haas, the implementation comprises three key components. Firstly, a background process named the walsummarizer continuously reads the Write-Ahead Log (WAL) to generate small WAL summary files containing vital information for determining which parts of the database require backing up. Secondly, the pg_basebackup tool now features an incremental backup mode, necessitating a backup manifest from a prior full backup. It reads WAL summary files between the previous full backup and the incremental backup to identify changed relation files. Lastly, a new utility, pg_combinebackup, validates and combines a full backup with one or more incremental backups to create a synthetic full backup or data directory.

To execute an incremental backup, users can leverage the new replication command UPLOAD_MANIFEST to upload the manifest for the prior backup, which could be a full backup or another incremental backup. The BASE_BACKUP command with the INCREMENTAL option is then employed to take the backup, and the pg_basebackup tool includes an --incremental=PATH_TO_MANIFEST option to trigger this behavior. Incremental backup files closely resemble regular full backups, but some relation files are replaced with those having names like INCREMENTAL.${ORIGINAL_NAME}. The backup_label file is also modified to indicate its status as an incremental backup. This feature is anticipated to be available in PostgreSQL 17, slated for release in September, promising an array of exciting changes for users of the database server.

Source: Phoronix.