6 Utilities
PDF page 82
Describes the major enhancements of utility commands.
3.4.1 Clusterdb
The –all and other options can now be used at the same time. [1b49d56]
3.4.2 Configure
The following features have been implemented in the configure command.
Output version
The LLVM and OpenSSL versions are now output when executing the configure command. [5e4dacb, 55a428a]
Injection Points
The Injection points are features that allow developers to execute custom code, assist in testing for complex conflicts, etc. To use this feature, it is necessary to specify –enable-injection-points when executing the configure command. [d86d20f]
PDF page 83
3.4.3 Initdb
The following enhancements have been implemented to the initdb command. [2d819a0, f69319f]
–locale-provider option
The “builtin” can now be specified as the locale provider.
–builtin-locale option
Added –builtin-locale option to specify the locale for built-in locale providers.
3.4.4 Pg_archivecleanup
The following new features have been added to the pg_archivecleanup command. [dd7c60f, 3f8c98d]
Long name options
The long name options have been added to the single-character options.
| -n | –dry-run | Outputs the name of the file to be deleted to standard |
|---|---|---|
| -x | –strip-extension=EXT | Specify extensions to exclude from file names. |
Short option Long option Description -d –debug Outputs debug logs to standard error.
PDF page 84
Remove history files
The –clean-backup-history option ( shortened option -b) has been added to remove the history files.
3.4.5 Pg_combinebackup
The new command pg_combinebackup has been added. This command merges base and incremental backups. [dc21234, a9577ba]
| Option name | Short option | Description |
|---|---|---|
| –debug | -d | Output debug information |
| –dry-run | -n | Run test only |
| –no-sync | -N | Don’t wait for storage sync |
| –output | -o | Output directory |
| –tablespace-mapping=OLD=NEW | -T | Tablespace mapping |
| –manifest-checksums=METHOD | - | Manifest checksum specification |
| –no-manifest | - | Don’t use manifest |
| –sync-method=METHOD | - | Specifying the storage synchronization method |
| –clone | - | Using the clone system call |
| –copy | - | Perform regular file copy (default) |
| –copy-file-range | - | Using the copy_file_range system call |
| –help | -? | Output usage information |
| –version | -V | Output version information |
PDF page 85
3.4.6 Pg_createsubscriber
The new command pg_createsubscriber has been added. This command converts a streaming replication standby server to a logical replication standby server. The major advantage of using this command is to reduce the initial data copy overhead that occurs when setting up a logical replication environment. [d44032d, c671e14]
| –database= DBNAME | -d | Database name for which to create |
|---|---|---|
| –pgdata=DATADIR | -D | Database cluster for streaming replication to be converted |
| –dry-run | -n | Conversion test |
| –subscriber-port=PORT | -p | Port number of the subscriber |
| –publisher-server=CONN | -P | Connection string to publisher |
| –socketdir=DIR | -s | Socket directory to use |
| –recovery-timeout=SECS | -t | Seconds to wait for recovery to end |
| –subscriber-username=USER | -U | SUBSCRIPTION owner |
| –publication=NAME | - | Name of the PUBLICATION |
| –replication-slot=NAME | - | Replication slot name |
| –subscription=NAME | - | SUBSCRIPTION name |
| –verbose | -v | |
| –config-file=FILE | - | Configuration file’s path |
| –version | -V | Output version information |
| –help | -? | Output usage information |
Option name Short option Description
PDF page 86
The following requirements are necessary to execute the pg_createsubscriber command.
The primary server parameter wal_level must be set to ’logical'.
The standby instance must be shut down. When the pg_createsubscriber command is executed, PUBLICATION and logical replication slots are created on the primary server with all tables in the specified database (FOR ALL TABLES). The standby server is no longer a standby for streaming replication and the SUBSCRIPTION is created. The default PUBLICATION and replication slot name created on the primary server and the SUBSCRIPTION name created on the standby server is “pg_createsubscriber_{DB OID}_{random integer}”.
3.4.7 Pg_basebackup
The following new features have been implemented in the pg_basebackup command.
–dbname option
If a database name is specified in the –dbname option (-d) at the same time as the –write-recoveryconf option (-R), the database name will be output to the primary_conninfo parameter setting specified in the postgresql.auto.conf file. [a145f42]
–help option
The default value of the –checkpoint option is now output in the help message. [cd02b35]
PDF page 87
–incremental option
The –incremental option ( shortened option -i) to perform incremental backups has been added. This option specifies the path to the manifest file on which the backup is based.
3.4.8 Pg_dump
The following options have been added to the pg_dump command.
–filter option
The –filter option has been added to the pg_dump / pg_dumpall / pg_restore commands. This option specifies the file that describes the list of objects to be included (or excluded) from the dump file. The format of the file is as follows. [a5cf808]
Syntax 22 - Filter file format
| Object type name | Object | Equivalent command options |
|---|---|---|
| extension | Extension | –extension |
| foreign_data | Foreign Table | –include-foreign-data |
| table | Table | –table |
| table_and_children | Table and Child Table | –table-and-children |
| table_data | Table data only | –exclude-table-data |
| table_data_and_children | Table and Child Table data | –exclude-table-data-and-children |
| schema | Schema | –schema |
PDF page 88
–exclude-extension option
The –exclude-extension option has been added to exclude extensions with specified pattern names. [522ed12]
3.4.9 Pg_restore
The pg_restore command now has a –transaction-size option to perform a commit once the specified number of objects have been processed. The default behavior is to commit on a per-SQL basis. This option provides an intermediate behavior between per-SQL commit and single-transaction processing with the –single-transaction option. [959b38d]
3.4.10 Pg_resetwal
The order in which options are displayed in the –help option has been changed. [b5da1b3]
PDF page 89
3.4.11 Pg_upgrade
The following features have been implemented to the pg_upgrade command.
PDF page 90
Preserve subscriber state
The subscriber (SUBSCRIPTION) state can now be preserved. In previous versions, only metadata was preserved. [9a17be1]
Migrate logical replication slot
The logical replication slots are now recreated on the destination cluster during upgrade. [29d0a77]
–copy-file-range option
The option –copy-file-range has been added to copy files using the copy_file_range system call in Linux and FreeBSD environments. [d93627b]
3.4.12 Pg_walsummary
The command pg_walsummary has been added. This command parses the contents of the WAL summary file. [ee1bfd1]
| Option name | Short option | Description | Note |
|---|---|---|---|
| –indivisual | -i | Outputs detailed block information | |
| –quiet | -q | Perform parsing of files only | |
| –help | -? | Output usage | |
| –version | -V | Output version information |
3.4.13 Pgindent
The option name of the pgindent command has been changed. [387aecc]
PDF page 91
| Option Name | Option Name | Note |
|---|---|---|
| –show-diff | –diff | |
| –silent-diff | –check |
3.4.14 Psql
The following enhancements have been implemented to the psql command.
View of Aggregate Functions
The argument names have been added to the view of aggregate functions with multiple arguments. [b575a26]
\sf, \ef, \sv, \ev meta-command
The semicolons (;) at the end of lines are now ignored. In previous versions, an error occurred. [390298f]
PDF page 92
\watch meta-command
The min_rows (abbreviated m), which indicates the minimum number of output tuples, has been added to the watch meta-command. The iterative operation terminates when the specified number of tuples are no longer output. In the example below, the \watch command terminates because all tuples have been deleted from the data1 table. [f347ec7]
3.4.15 Reindexdb
The following features have been added to the reindexdb command.
Combining options
The –all and other options can now be used at the same time. [24c928a]
PDF page 93
Parallelization
The –jobs and –index options can now be used at the same time. Multiple indexes on different tables can be processed in parallel. [47f99a4]
3.4.16 Vacuumdb
The –all and other options can now be used at the same time. [648928c]
3.4.17 More than one command
The following commands now have an additional option “–sync-method” to determine the storage synchronization method for files. This option is disabled if the –no-sync option is specified. The utilities for which the –sync-method option has been added are as follows. [8c16ad3, cccc6cd]
initdb
pg_basebackup
pg_checksums
pg_dump
pg_rewind
pg_upgrade
| Value for option | Description | Note |
|---|---|---|
| fsync | Recursively synchronize file-by-file using the fsync system call. | Default |
| syncfs | Synchronize the entire file system using the syncfs system call. | Synchronize the entire file system using the syncfs system call. |
PDF page 94