LinuxCommandLibrary

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]"
copy
Rewind from local source
$ pg_rewind -D [target_dir] --source-pgdata=[source_dir]
copy
Dry run
$ pg_rewind -n -D [target_dir] --source-server="[conninfo]"
copy

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community