pg_rewind
synchronizes a PostgreSQL cluster with another copy
TLDR
Rewind target to source
$ pg_rewind -D [target_dir] --source-server="host=[host] dbname=[db]"
Rewind from local source$ pg_rewind -D [target_dir] --source-pgdata=[source_dir]
Dry run$ pg_rewind -n -D [target_dir] --source-server="[conninfo]"
SYNOPSIS
pg_rewind [options]
DESCRIPTION
pg_rewind synchronizes a PostgreSQL cluster with another copy. Resynchronizes diverged clusters after failover. Faster than full backup for failed primary recovery.
PARAMETERS
-D, --target-pgdata dir
Target data directory.--source-pgdata dir
Source data directory.--source-server conninfo
Source connection string.-n, --dry-run
Show what would be done.-P, --progress
Show progress.
SEE ALSO
pg_basebackup(1), pg_resetwal(1)
