Files
tldr/pages/common/pg_rewind.md
T
Alessandro Chitarrini bc1f42ad06 pg_rewind: add page (#18857)
* pg_rewind: add page

* Update pg_rewind.md

---------

Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
2025-10-18 15:50:14 -07:00

854 B

pg_rewind

Synchronize a PostgreSQL data directory with another data directory that was forked from it. More information: https://www.postgresql.org/docs/current/app-pgrewind.html.

  • Synchronize target directory with source directory:

pg_rewind {{[-D|--target-pgdata]}} {{path/to/target_data}} --source-pgdata {{path/to/source_data}}

  • Synchronize target with source server using connection string:

pg_rewind {{[-D|--target-pgdata]}} {{path/to/target_data}} --source-server {{connstr}}

  • Perform a dry run:

pg_rewind {{[-D|--target-pgdata]}} {{path/to/target_data}} --source-pgdata {{path/to/source_data}} {{[-n|--dry-run]}}

  • Show progress during synchronization:

pg_rewind {{[-D|--target-pgdata]}} {{path/to/target_data}} --source-pgdata {{path/to/source_data}} {{[-P|--progress]}}

  • Display help:

pg_rewind {{[-?|--help]}}