6 Utilities
PDF page 75
Describes the major enhancements of utility commands.
3.4.1 Configure
The following new features have been added to the configure command.
Adding the –with-liburing option
The option –with-liburing has been added to use io_uring for asynchronous I/O on Linux. Enabling this option allows specifying io_uring for the parameter io_method. [c325a76]
Addition of –with-libcurl option
The option –with-libcurl option has been added for OAUTHBeare/SASL functionality. [b3f0be7]
Addition of –with-libnuma option
The option –with-libnuma has been added to detect NUMA environments. [65c298f]
3.4.2 Initdb
The following options have been added to the initdb command.
Option –no-data-checksums
Generation of page checksums is now enabled by default in the initdb command. With this specification, the option –no-data-checksums, which does not generate page checksums, has been added. If used at the same time as the –data-checksums option, which generates checksums, the option specified later will take effect. [983a588]
PDF page 76
Option –no-sync-data-files
Added new option –no-sync-data-files. This option skips synchronization of directories and files in the database cluster. Unless the –no-sync option is specified, directories such as pg_wal and pg_xact will be written synchronously as in the previous version. [cf131fa]
3.4.3 Pg_combinebackup
The option –link (short form -k) has been added. This option composites backup data using hard links instead of file copies. [99aeb84]
3.4.4 Pg_createsubscriber
The following options have been added to the pg_createsubscriber command.
Option –all
The –all option (short form -a) specifies that subscriptions should be created for all databases on the publisher’s side to which it connects. [fb2ea12]
PDF page 77
Option –enable-two-phase
The option –enable-two_phase has been added to enable the two_phase option for the subscriptions being created (short form -T). [e117cfb]
Option –clean
The –clean option specifies the type of object to be removed from the subscriber. Currently, only ‘publications’ are supported. [e5aeed4, 60dda7b]
3.4.5 Pg_dump
The following options have been added to the pg_dump command. [9c49f0e, bde2fb7, 34eb2a8]
| Option name | Description | Note |
|---|---|---|
| –sequence-data | Output sequence data | |
| –with-statistics | Dump statistics data | |
| –no-statistics | Do not dump statistics | default |
PDF page 78
3.4.6 pg_dumpall
The following options have been added to the pg_dumpall command.
Option –sequence-data
Added –sequence-data option to dump sequence information. Sequence information is dumped by default, but when used with the –no-data option, the latest sequence values are set. [cea3fc4]
Options for optimizer statistics
Options for dumping statistics have been added. The –statistics option and -statistics-only option dump statistics, the –no-statistics option is the default behavior and does not dump statistics. [34eb2a8]
3.4.7 Pg_dump / pg_dumpall / pg_restore command
The pg_dump, pg_restore, and pg_dumpall commands now have an option to migrate statistics. The following options have been added. [1fd1bd8, cd3c451, acea3fc, 34eb2a8, 6a46089, 71ea0d6]
PDF page 79
| Option name | Description | pg_dump / pg_dumpall | pg_restore |
|---|---|---|---|
| –no-data | Contains no data | Yes | Yes |
| –no-policies | Contains no Row Level Security settings | Yes | Yes |
| –no-schema | Contains no schema | Yes | Yes |
| –no-statistics | Contains no statistics | Yes | Yes |
| –restrict-key=KEY | Restrict meta commands | Yes | Yes |
| –sequence-data | Contains sequence data | Yes | No |
| –statistics | Contains optimizer statistics data | Yes | No |
| –statistics-only | Contains only statistics | Yes | No |
PDF page 80
3.4.8 Pg_recvlogical
The following features have been implemented to the pg_recvlogical command.
Option –enable-failover
The option –enable-failover has been added. Specifying this option adds a ‘failover’ option to the replication slot. This option is specified at the same time as the –create-slot option. [cf2655a]
Option –enable-two-phase
The option name –two-phase has been changed to –enable-two-phase. The previous option remains available. [6d12d5a]
Option –drop-slot
In previous versions, the –dbname option was required when using the –drop-slot option. In PostgreSQL 18, the –dbname option is no longer required. [c68100a]
3.4.9 Pg_resetwal
The option –char-signedness has been added to the pg_resetwal command. This option changes the sign setting of the char type in the control file. This option is expected to be specified within the pg_upgrade command and is not intended to be specified manually. [30666d1]
3.4.10 Pg_rewind
The –write-recovery-conf option of pg_rewind has been extended to include the database name (dbname) in the primary_conninfo value generated when specified with the –source-server option. This change allows rewound servers to connect to the primary server without having to manually modify the configuration file when sync_replication_slots is enabled. [4ecdd41]
3.4.11 Pg_upgrade
The following new features have been added to the pg_upgrade command.
Option –set-char-signedness
The option –char-signedness has been added to the pg_upgrade command. This option changes the signedness setting of the char type in the control file. [1aab680]
PDF page 81
Statistics migration
The statistics are now migrated in the default configuration. Specify the –no-statistics option to not migrate statistics. [1fd1bd8]
Internally executed command processing
Internally executed pg_dump and pg_dumpall commands are executed with the option –no-sync. Internally executed CREATE DATABASE statement executed with STORATEGY=FILE_COPY clause. [64f34eb, 6e16b1e]
3.4.12 Pg_verifybackup
The pg_verifybackup command can now also verify backups in tar format. The format of the backup target is specified with the –format option (short form -F). When using this option, the –no-parse-wal option must also be specified at the same time. [8dfd312]
3.4.13 Psql
The following new features have been implemented in the psql command.
Option –help=variables
The xheader_width description has been added to the output destination of the command option -help=variables. [768dfd8]
PDF page 82
Prepared statement definition
The following metacommands have been added to manipulate the definition of Prepared statements [d55322b]
| Metacommand | Description | Note |
|---|---|---|
| \parse | Create a Prepared statement | |
| \bind_named | Bind a value to a parameter | |
| \close | Close a Prepared statement |
Metacommand \dP+
The name of the access method (Access method) for the partition table is now printed. [978f38c]
PDF page 83
Metacommands \df+, \do+, \dAo+, \dC+
The output of each command now includes a “Leakproof?” column indicating whether it is leakproof. [2355e51]
Pipeline
The following metacommands have been added to support the pipeline. [41625ab, 3ce3575, 17caf66]
PDF page 84
| Metacommand | Description | Note |
|---|---|---|
| \startpipeline | Start pipeline | |
| \sendpipeline | Send extended query | |
| \syncpipeline | Synchronize pipeline | |
| \endpipeling | End pipeline | |
| \flushrequest | Request flush | |
| \flush | Send unsent data | |
| \getresults | Get execution results | Allow specifying number of fetches |
The following variables are available to show the results of executing the above commands.
| Variable name | Description | Note |
|---|---|---|
| PIPELINE_SYNC_COUNT | Number of pipes synchronized | |
| PIPELINE_COMMAND_COUNT | Number of commands piped | |
| PIPELINE_RESULT_COUNT | Number of results executed |
PDF page 85
Output in extended table format mode
By specifying x for some metacommands, the execution results are output in extended table format mode. In addition to the \d* metacommand, it can also be specified with \l, \z, or \lo. [00f4c29]
PDF page 86
Variable SERVICE
The variable SERVICE is now available to indicate the name of the service used for the connection. Specify %s to include the service name in the prompt string. [477728b]
Title by object type
The titles of object list metacommands such as \dt and \di now change according to object type. In the previous version, they were all “List of relations”. [a14707d]
PDF page 87
Metacommand \dx
The output of the \dx metacommand now includes the “Default version” entry for the extension. [d696406]
PDF page 88
Metacommand \conninfo
The output of the conninfo metacommand has been substantially changed. [bba2fbc, be37ac2, 6d64800]
3.4.14 Vacuumdb
The vacuumdb command now has a –missing-stats-only option to analyze only columns and indexes with missing object statistics. This option must be specified in conjunction with the –analyze-only or –analyze-in-stages option. [edba754]
PDF page 89