Name
pgx_dmpall - Backs up the data directory, tablespaces, and configuration files.
Synopsis
pgx_dmpall [option...]
Description
The pgx_dmpall command backs up the data directory, tablespaces, and configuration files. The backup data is stored in the directory specified by backup_destination parameter of postgresql.conf. The pgx_dmpall command also deletes archived Write Ahead Logs (WAL) that are no longer necessary for recovery when the backup completes successfully.
Options
This option only backs up configuration files. The configuration files are as follows:
postgresql.conf (postgresql.conf)
File for host-based authentication (pg_hba.conf)
Configuration file for ident authentication (pg_ident.conf)
If an external reference, such as 'include' in postgresql.conf, is set, the reference destination files are also backed up.
Sets checkpoint mode to fast or spread (default).
If fast is specified, the checkpoint processing at the start of backup becomes quick, but the impact on performance of running applications gets larger due to intense I/O. In spread mode, the impact on applications is smaller but the backup takes longer, because the checkpoint is performed slowly.
Specify the data directory. If this option is omitted, the value of the environment variable PGDATA is used.
Specify the postgresql.conf configuration file. This option is set if the data directory and the configuration file set in the 'data_directory' parameter of the postgresql.conf file are running in separate directories.
Specify the full path of the file containing the names of the tablespaces to be backed up using the copy command, using less than 1024 bytes.
The file format is described below:
tablespaceName<newline>
tablespaceName<newline>
...
Tablespaces not listed in the specified file are backed up to the backup storage directory. If this option is not specified, all tablespaces are backed up using the copy command.
This option can be specified if the -Y option has been specified, and it is used to limit the tablespaces backed up using the copy command.
Specify the user name of the database superuser. This defaults to the name of the effective user running pgx_dmpall.
Specify the full path of the file of the copy command for backup, using less than 1024 bytes. This option cannot be specified together with the -c option.
Never issue 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.
Force pgx_dmpall to prompt for a password before connecting to a database.
This option is never essential, since pgx_dmpall will automatically prompt for a password if the server demands password authentication. However, pgx_dmpall will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.
Specifies the name of the database to connect to. If not specified, the postgres database will be used; if that does not exist, template1 will be used.
Any database can be specified as long as it can be connected to.
Excludes a database cluster from backup via the copy command. This option can be specified if the -Y option has been specified. If this option is not specified, the database cluster will be backed up using the copy command.
Environment
Specify the data directory. You can overwrite using the -D option.
Diagnostics
0: Normal end
Other than 0: Abnormal end
Notes
This command can only be executed when the database server is running.
Execute this command as a PostgreSQL user account.
Do not update or delete files in the backup storage directory. Otherwise, you may not be able to recover the database.
Do not store other files in the backup storage directory.
This command uses one database connection. To establish a connection, this command uses the UNIX domain socket on the operating systems. Therefore, permit this connections in pg_hba.conf.
This command cannot be executed on the standby server.
Example
In the following example, the data directory, tablespaces, and configuration files are backed up. At this time, stored WALs are no longer necessary because the backups are destroyed.
$ pgx_dmpall
Related item
pgx_rcvall