You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation.md
+22-15
Original file line number
Diff line number
Diff line change
@@ -709,7 +709,7 @@ User name to connect as.
709
709
710
710
-w
711
711
--no-password
712
-
Disables a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
712
+
Disables a password prompt. If the server requires password authentication and a password is not available by other means such as a [.pgpass](https://www.postgresql.org/docs/current/libpq-pgpass.html) file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
713
713
714
714
-W
715
715
--password
@@ -720,7 +720,7 @@ You can use these options together with [backup](#backup) and [archive-push](#ar
720
720
721
721
--compress-algorithm=compression_algorithm
722
722
Default: none
723
-
Defines the algorithm to use for compressing data files. Possible values are zlib, pglz, and none. If set to zlib or pglz, this option enables compression. By default, compression is disabled.
723
+
Defines the algorithm to use for compressing data files. Possible values are `zlib`, `pglz`, and `none`. If set to zlib or pglz, this option enables compression. By default, compression is disabled.
724
724
For the `archive-push` command, the pglz compression algorithm is not supported.
725
725
726
726
--compress-level=compression_level
@@ -731,13 +731,13 @@ Defines compression level (0 through 9, 0 being no compression and 9 being best
731
731
Alias for `--compress-algorithm=zlib` and `--compress-level=1`.
732
732
733
733
##### Archiving Options
734
-
These options can be used with [archive-push](#archive-push) and [archive-get](#archive-get) commands.
734
+
These options can be used with [archive-push](#archive-push) and [archive-get](#archive-get) commands in [archive_command](https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-ARCHIVE-COMMAND) and [restore_command](https://www.postgresql.org/docs/current/archive-recovery-settings.html#RESTORE-COMMAND) settings.
735
735
736
736
--wal-file-path=wal_file_path %p
737
-
Provides the path to the WAL file in `archive_command` and `restore_command` used by pg_probackup. The %p variable is required for correct processing.
737
+
Provides the path to the WAL file in `archive_command` and `restore_command`. The %p variable is required for correct processing.
738
738
739
739
--wal-file-name=wal_file_name %f
740
-
Provides the name of the WAL file in `archive_command` and `restore_command` used by pg_probackup. The %f variable is required for correct processing.
740
+
Provides the name of the WAL file in `archive_command` and `restore_command`. The %f variable is required for correct processing.
741
741
742
742
--overwrite
743
743
Overwrites archived WAL file. Use this option together with the archive-push command if the specified subdirectory of the backup catalog already contains this WAL file and it needs to be replaced with its newer copy. Otherwise, archive-push reports that a WAL segment already exists, and aborts the operation. If the file to replace has not changed, archive-push skips this file regardless of the `--overwrite` option.
@@ -774,6 +774,7 @@ Specifies a string of SSH command-line options.
774
774
775
775
##### Replica Options
776
776
This section describes the options related to taking a backup from standby.
777
+
777
778
>NOTE: Starting from pg_probackup 2.0.24, backups can be taken from standby without connecting to the master server, so these options are no longer required. In lower versions, pg_probackup had to connect to the master to determine recovery time — the earliest moment for which you can restore a consistent state of the database cluster.
778
779
779
780
--master-db=dbname
@@ -844,9 +845,9 @@ STREAM backups include all the WAL segments required to restore the cluster to a
844
845
845
846
Even if you are using [continuous archiving](#setting-up-continuous-wal-archiving), STREAM backups can still be useful in the following cases:
846
847
847
-
1. STREAM backups can be restored on the server that has no file access to WAL archive.
848
-
2. STREAM backups enable you to restore the cluster state at the point in time for which WAL files are no longer available.
849
-
3. Creating backup from standby of a server that generates small amount of WAL traffic and using [archive_timeout](https://www.postgresql.org/docs/9.6/runtime-config-wal.html#GUC-ARCHIVE-TIMEOUT) is not an option.
848
+
- STREAM backups can be restored on the server that has no file access to WAL archive.
849
+
- STREAM backups enable you to restore the cluster state at the point in time for which WAL files are no longer available.
850
+
- Backup in STREAM mode can be taken from standby of a server, that generates small amount of WAL traffic, without long waiting for WAL segment to fill up.
850
851
851
852
##### External directories
852
853
To back up a directory located outside of the data directory, use the optional `--external-dirs` parameter that specifies the path to this directory. If you would like to add more than one external directory, provide several paths separated by colons.
@@ -857,7 +858,7 @@ For example, to include '/etc/dir1/' and '/etc/dir2/' directories into the full
857
858
858
859
pg_probackup creates a separate subdirectory in the backup directory for each external directory. Since external directories included into different backups do not have to be the same, when you are restoring the cluster from an incremental backup, only those directories that belong to this particular backup will be restored. Any external directories stored in the previous backups will be ignored.
859
860
860
-
To include the same directories into each backup of your instance, you can specify them in the pg_probackup.conf configuration file using the `set-config` command with the `--external-dirs` option.
861
+
To include the same directories into each backup of your instance, you can specify them in the pg_probackup.conf configuration file using the [set-config](#set-config) command with the `--external-dirs` option.
861
862
862
863
#### Verifying a Cluster
863
864
@@ -888,18 +889,22 @@ Logical verification can be done more thoroughly with option `--heapallindexed`
888
889
889
890
#### Validating Backups
890
891
891
-
pg_probackup calculates checksums for each file in a backup during `backup` process. The process of checking checksumms of backup data files is called `backup validation`. By default validation is run immediately after backup is taken and right before restore, to detect possible backup corruptions.
892
+
pg_probackup calculates checksums for each file in a backup during backup process. The process of checking checksumms of backup data files is called `backup validation`. By default validation is run immediately after backup is taken and right before restore, to detect possible backup corruptions.
892
893
893
-
If you would like to skip backup validation, you can specify the `--no-validate` option when running `backup` and `restore` commands.
894
+
If you would like to skip backup validation, you can specify the `--no-validate` option when running [backup](#backup) and [restore](#restore) commands.
894
895
895
-
To ensure that all the required backup files are present and can be used to restore the database cluster, you can run the [validate](#validate) command with the exact recovery target options you are going to use for recovery. If you omit all the parameters, all backups are validated.
896
+
To ensure that all the required backup files are present and can be used to restore the database cluster, you can run the [validate](#validate) command with the exact recovery target options you are going to use for recovery.
896
897
897
898
For example, to check that you can restore the database cluster from a backup copy up to the specified xid transaction ID, run this command:
If validation completes successfully, pg_probackup displays the corresponding message. If validation fails, you will receive an error message with the exact time, transaction ID and LSN up to which the recovery is possible.
902
903
904
+
If you specify *backup_id* via `-i/--backup-id` option, then only backup copy with specified backup ID will be validated. If *backup_id* belong to incremental backup, then all its parents starting from FULL backup will be validated.
905
+
906
+
If you omit all the parameters, all backups are validated.
907
+
903
908
#### Restoring a Cluster
904
909
905
910
To restore the database cluster from a backup, run the restore command with at least the following options:
@@ -918,7 +923,9 @@ When using the `--tablespace-mapping/-T` option, you must provide absolute paths
Once the restore command is complete, start the database service. If you are restoring an STREAM backup, the restore is complete at once, with the cluster returned to a self-consistent state at the point when the backup was taken. For ARCHIVE backups, PostgreSQL replays all available archived WAL segments, so the cluster is restored to the latest state possible. You can change this behavior by using the [recovery target options](#recovery-target-options) with the `restore` command. Note that using the [recovery target options](#recovery-target-options) when restoring STREAM backup is possible if the WAL archive is available at least starting from the time the STREAM backup was taken.
926
+
Once the restore command is complete, start the database service.
927
+
928
+
If you are restoring an STREAM backup, the restore is complete at once, with the cluster returned to a self-consistent state at the point when the backup was taken. For ARCHIVE backups, PostgreSQL replays all available archived WAL segments, so the cluster is restored to the latest state possible. You can change this behavior by using the [recovery target options](#recovery-target-options) with the `restore` command. Note that using the [recovery target options](#recovery-target-options) when restoring STREAM backup is possible if the WAL archive is available at least starting from the time the STREAM backup was taken.
922
929
923
930
>NOTE: By default, the [restore](#restore) command validates the specified backup before restoring the cluster. If you run regular backup validations and would like to save time when restoring the cluster, you can specify the `--no-validate` option to skip validation and speed up the recovery.
924
931
@@ -994,11 +1001,11 @@ To view the current settings, run the following command:
You can override the settings defined in pg_probackup.conf when running the backup command via corresponding environment variables and/or command line options.
1004
+
You can override the settings defined in pg_probackup.conf when running pg_probackups [commands](#commands) via corresponding environment variables and/or command line options.
998
1005
999
1006
###### Specifying Connection Settings
1000
1007
1001
-
If you define connection settings in the *pg_probackup.conf* configuration file, you can omit connection options in all the subsequent pg_probackup commands. However, if the corresponding environment variables are set, they get higher priority. The options provided on the command line overwrite both environment variables and configuration file settings.
1008
+
If you define connection settings in the 'pg_probackup.conf' configuration file, you can omit connection options in all the subsequent pg_probackup commands. However, if the corresponding environment variables are set, they get higher priority. The options provided on the command line overwrite both environment variables and configuration file settings.
1002
1009
1003
1010
If nothing is given, the default values are taken. By default pg_probackup tries to use local connection via Unix domain socket (localhost on Windows) and tries to get the database name and the user name from the PGUSER environment variable or the current OS user name.
0 commit comments