6 Utilities
PDF page 74
Describes the major enhancements of utility commands.
3.4.1 Configure
The configure command has the following options changed. [9db49fc, d3b111e, fcb21b3]
| Option name | Modify | Description |
|---|---|---|
| –with-gnu-ld | Remove | Assume the C compiler uses GNU ld |
| –with-segsize-blocks | Add | Set table segment size in blocks |
| –with-icu | Remove | Build with ICU support |
| –without-icu | Add | Build without ICU support |
3.4.2 Createuser
Multiple options have been added to the createuser command. The –role option can still be used, but it is deprecated. [08951a7, 2dcd157, 381d19b]
| Option name | Short option | Description |
|---|---|---|
| –with-admin=ROLE | -a | ROLE will be a member of new role with admin option |
| –with-member=ROLE | -m | ROLE will be a member of new role |
| –valid-until=TIMESTAMP | -v | Password expiration |
| –bypassrls | - | Add Bypass RLS attribute |
| –no-bypassrls | - | Do not assign Bypass RLS attribute |
| –member-of=ROLE | -g | new role will be a member of ROLE (modified from –role option) |
PDF page 75
3.4.3 Initdb
The following enhancements have been implemented to the initdb command: [27b6237, 30a53b7, 3e51b27, af3abca]
–icu-rules option
The –icu-rules option has been added to add a custom rule to the ICU locale.
–set option
The –set option (shorthand option is -c) specifies the initial values of the parameters described in the postgresql.conf file. This option can be specified multiple times.
PDF page 76
Check locale command
The initdb command now exits successfully even if the ’locale’ command does not exist. In previous versions, the initdb command would fail if the locale -a command failed.
3.4.4 Pgindent
The following options have been added/extended to the pgindent command. [b90f0b5, a1c4cd6, 068a243, b16259b]
| Option name | Change | Description |
|---|---|---|
| –build | Remove | Building the pg_bsd_indent command |
| –code-base | Remove | Specifying base directory for source code |
| –commit=gitref | Add | Target files changed in the specified commit |
| –excludes=PATH | Change | Can be specified multiple times |
| –help | Add | Output usage |
| –show-diff | Add | View changes |
| –silent-diff | Add | Exit with return value 2 if there are any changes |
3.4.5 Pg_basebackup
It is now possible to specify ’long’ for the level of the Zstandard compression method. This option improves the compression ratio for large data, but increases resource usage. [2820adf]
PDF page 77
3.4.6 Pg_bsd_indent
The BSD-style indentation tool the pg_bsd_indent command, developed in a separate project, has been incorporated into the core repository. [4e831f4]
3.4.7 Pg_dump
The following enhancements have been implemented in the pg_dump command. [5e73a60, 0da243f, 84adc8e, 2820adf, 35ce24c, 2f80c95, a563c24, 5f53b42]
–compress option
The –compress option now accepts a compression method and compression level separated by a colon (:). The compression method can be none, gzip, lz4 or zstd. The value that can be specified for compression level differs depending on the compression method.
| Compression Method | Default level | Level Range | Note |
|---|---|---|---|
| none | - | - | |
| gzip | -1 | 1~9 | |
| lz4 | 0 | 1~12 | |
| zstd | 3 | -131072~22, long |
PDF page 78
–large-objects option
The –blob and –no-blob options from previous versions have been changed to –large-objects and - -no-large-objects. Legacy options are still available, but are deprecated.
–table-and-children option
Basically, the same as the –table option. Includes tables matching the pattern and their child tables and partitions.
PDF page 79
–exclude-table-and-children option
Basically, the same as the –exclude-table option. Exclude tables matching the pattern and their child tables and partitions.
–exclude-table-data-and-children option
Basically, the same as the –exclude-table-data option. Exclude data from tables matching the pattern and their child tables and partitions.
Lock acquisition
The pg_dump command executes a LOCK TABLE statement on the target table at startup. In PostgreSQL 16, multiple table names are described for one LOCK TABLE to reduce the amount of communication between the client and server.
3.4.8 Pg_receivewal / Pg_recvlogical
The SIGTERM signal has been added as a program exit condition in addition to the existing SIGINT signal. This change corresponds to the default value of the systemd exit signal (KillSignal). [8b60db7]
3.4.9 Pg_upgrade
Add the –copy option to the pg_upgrade command. This is the default behavior. Copies locale and encoding information from source to destination. [746915c, 9637bad]
3.4.10 Pg_verifybackup
Add the –progress option (shortened option -P). Report progress. [d07c294]
PDF page 80
3.4.11 Pg_waldump
The following new features have been added to the pg_waldump command. [d497093, 4c8044c , b381d96]
–save-fullpage option
Add the –save-fullpage option to specify the directory to save full page images. The specified directory must be empty. A full-page image is created with the following file name:
PDF page 81
| Notation | Description | Example |
|---|---|---|
| Timeline hexadecimal format | 00000000 | |
| LSN hexadecimal format | 05AD6E48 | |
| OID of the tablespace | 1663 | |
| OID of the database | 5 | |
| Relation filenode | 16388 | |
| Block number | 20 | |
| Fork name | main |
–timeline option
The –timeline option now accepts hexadecimal strings.
PDF page 82
3.4.12 Psql
The following enhancements have been implemented to the psql command: [b0d8f2d, 31ae2aa, bd95816, 5b66de3, a45388d, d913928, 6f9ee74, 31ae2aa]
Command execution status
The execution status of !, \g, \o, \w, and \copy metacommands can now be obtained with the following variables.
| Variable name | Description |
|---|---|
| SHELL_ERROR | ’true’ if command execution result is 0, ‘false’ if not 0 |
| SHELL_EXIT_CODE Command exit code | Commandexitcode |
\d+ metacommand
Executing the \d+ meta command on a partitioned table will output “FOREIGN” if the partition is an external table.
PDF page 83
\bind metacommand
Add \bind metacommand to set values for bind variables in SQL statements. A semicolon (;) is not considered a line terminator, so specify something like \g.
PDF page 84
\pset metacommand
Add the xheader_width option to \pset metacommand. This option can limit the width of the header when outputting in extended table format. The values that can be specified are as follows.
| Value | Description | Note |
|---|---|---|
| full | Widest line length (default) | |
| column | Truncate to Width of First Column | |
| page | Truncate to Terminal Page Width | |
| Numerical value | Truncate to Specified Number |
PDF page 85
\dpS metacommand
‘S’ can now be specified for \dp meta-command and \z meta-command. Along with this, the operation of the \dp or \z command has been changed from the previous version. Temporary objects were included in the list, and objects in the information_schema schema were excluded.
\watch metacommand
Add validation of entered values. Any non-numeric or negative value will result in an error. Specify zero (0) to rerun without an interval. Also, the number of reruns can now be specified. To limit the number of re-executions, specify the interval and the number of executions in the “i=interval c=number of times of execution” format.
PDF page 86
\drg metacommand
Added \drg meta command to output role grant information. [d65ddac]
3.4.13 Vacuumdb
The following options have been added to the vacuumdb command. [7781f4e, 4211fbd, ae78cae]
–schema option
Specify the name of the schema to which the table to be VACUUMed belongs. The shorthand option is -n. This option can be specified multiple times. This option cannot be used with the –excludeschema option.
–exclude-schema option
Specify the name of the schema to which the table that does not execute VACUUM belongs. The shorthand option is -N. This option cannot be used at the same time as the –schema option.
PDF page 87
–no-process-main option
Added the option –no-process-main for the VACUUM (PROCESS_MAIN FALSE) statement.
–buffer-usage-limit option
Add the –buffer-usage-limit option for VACUUM (BUFFER_USAGE_LIMIT) statement.
PDF page 88