RefLib

Reference library for AI

Back

postgresql_16:7.3.7.2 Options

PostgreSQL 16 > Reference > PostgreSQL Server Applications > pg_rewind > Options

pg_rewind accepts the following command-line arguments: -D *directory* --target-pgdata=*directory* This option specifies the target data directory that is synchronized with the source. The target server must be shut down cleanly before running pg_rewind --source-pgdata=*directory* Specifies the file system path to the data directory of the source server to synchronize the target with. This option requires the source server to be cleanly shut down. --source-server=*connstr* Specifies a libpq connection string to connect to the source PostgreSQL server to synchronize the target with. The connection must be a normal (non-replication) connection with a role having sufficient permissions to execute the functions used by pg_rewind on the source server (see Notes section for details) or a superuser role. This option requires the source server to be running and accepting connections. -R --write-recovery-conf Create standby.signal and append connection settings to postgresql.auto.conf in the output directory. --source-server is mandatory with this option. -n --dry-run Do everything except actually modifying the target directory. -N --no-sync By default, pg_rewind will wait for all files to be written safely to disk. This option causes pg_rewind to return without waiting, which is faster, but means that a subsequent operating system crash can leave the data directory corrupt. Generally, this option is useful for testing but should not be used on a production installation. -P --progress Enables progress reporting. Turning this on will deliver an approximate progress report while copying data from the source cluster. -c --restore-target-wal Use restore_command defined in the target cluster configuration to retrieve WAL files from the WAL archive if these files are no longer available in the pg_wal directory. --config-file=*filename* Use the specified main server configuration file for the target cluster. This affects pg_rewind when it uses internally the postgres command for the rewind operation on this cluster (when retrieving restore_command with the option -c/--restore-target-wal and when forcing a completion of crash recovery). --debug Print verbose debugging output that is mostly useful for developers debugging pg_rewind. --no-ensure-shutdown pg_rewind requires that the target server is cleanly shut down before rewinding. By default, if the target server is not shut down cleanly, pg_rewind starts the target server in single-user mode to complete crash recovery first, and stops it. By passing this option, pg_rewind skips this and errors out immediately if the server is not cleanly shut down. Users are expected to handle the situation themselves in that case. -V --version Display version information, then exit. -? --help Show help, then exit.

Back