13 Change of Utility
PDF page 86
This section explain the major function enhancement points of utility commands.
3.11.1 psql
The following functions have been added to the psql command.
\d command
The format of table information outputted by \d command has been changed. “Modifier” column that was conventionally used has been divided into Collation, Nullable, and Default.
Additional information of the \timing command
The \timing command controls the output of the execution time of the SQL statement. In the new version, time format that is easy to understand has been added to the execution time output. When the SQL execution time is less than 1 second, it is outputted in the same format as the old version.
PDF page 87
\gx command
The \gx command reruns the most recently executed SQL statement in the extended format.
\set command
More parameters have been displayed by the \set command.
PDF page 88
\if, \elif, \else, \endif command
It is now possible to perform conditional branching within the psql command. Conditional branching can be performed between \if, \else, and \endif, and the commands there between are treated as a block. For \If command and \elif command, the parameters that can determined True or False must be specified. It is also possible to nest conditional statements.
3.11.2 pg_ctl
The following functions have been added to the pg_ctl command.
Wait for promotion
The pg_ctl command can specify an option ‘-w’ to wait for the standby instance to be promoted. In the past, it was necessary to refer to the trigger file to confirm completion of promotion.
Added aliases for options
“–wait” and “–no-wait " can be used as aliases for option “-w” and “-W “. Also, “–options” can be used for “-o” to specify options.
Wait for startup (-w) to default
By default, all operations have become to wait for operation completion (–wait). In the past, the default behavior of instance startup and promotion processing did not wait for operation completion.
3.11.3 pg_basebackup
The following changes have been added to the pg_basebackup command.
PDF page 89
Change default mode
The default WAL transfer mode is now Stream. For this reason, connections to multiple wal sender processes are used by default.
Discontinue the -x option
The -x option (–xlog option) has been deprecated.
Change the -X option
For -X option, value “none” which means that transaction log does not included in the backup can be specified now. Also, the long option name has been changed from “–xlog-method” to “–wal-method”.
Change the –xlogdir option
The option name has been changed from “–xlogdir” to “–waldir”.
-Ft option and -Xstream option combination
The option to output backup data to tar file -Ft and the -Xstream option can now be used at the same time. In this case, the pg_wal.tar file in which transaction logs are stored in the directory specified by the -D option is output.
Using temporary replication slots
When the slot name (-S) is not specified (and –no-slot is not specified), temporary replication slot is
PDF page 90
used. Below is the log when log_replication_commands parameter is set to “on”. Temporary slots with names starting with pg_basebackup_ have been created.
Cleanup on error
When an error occurs during the pg_basebackup command or when a signal received, the file in the directory specified by the -D parameter will be deleted. If you do not want the delete operation, you can specify the parameter –no-clean (or -n).
–verbose mode output
More detailed information is displayed when parameter –verbose (or -v) is specified.
PDF page 91
3.11.4 pg_dump
The following options have been added.
-B (–no-blobs)
Exclude large objects
–no-subscriptions
Exclude SUBSCRIPTION objects used for Logical Replication
–no-publications
Exclude PUBLICATION objects used for Logical Replication
–no-sync
Does not execute sync system call after writing file. By default, the sync call is executed to ensure a reliable write operation.
3.11.5 pg_dumpall
The following options have been added.
–no-sync
Does not execute sync system call after writing file. By default, the sync call is executed to ensure a reliable write operation.
–no-role-passwords
Does not dump role’s password.
–no-subscriptions
Exclude SUBSCRIPTION objects used for Logical Replication
–no-publications
PDF page 92
Exclude PUBLICATION objects used for Logical Replication
3.11.6 pg_recvlogical
The -E option (–endpos option) to terminate the program after receiving the specified LSN has been added
3.11.7 pgbench
“–log-prefix” parameter to change the prefix string of the log file has been added. The default value is “pgbench_log” as in the previous version. In addition to the above, some new functions were provided to the pgbench command, but no verification has been done.
3.11.8 initdb
“–noclean” and “–nosync” options have been changed to “–no-clean” and “–no-sync” option.
3.11.9 pg_receivexlog
The name of the command was changed to pg_receivewal. The –compress parameter can now be specified to compress the output WAL file. Compression ratio can be specified from 0 to 9. In order to use this function it is necessary to build in the environment where the libz library is installed.
3.11.10 pg_restore
The following options have been added.
-N (–exclude-schema)
To specify the name of the schema not to be restored has been added.
–no-subscriptions
Exclude SUBSCRIPTION objects used for Logical Replication
–no-publications
Exclude PUBLICATION objects used for Logical Replication
3.11.11 pg_upgrade
Internally it treats tables and sequences as separate objects.
PDF page 93
3.11.12 createuser
“–unencrypted” option (-N option) has been deprecated.
3.11.13 createlang / droplang
The createlang command, droplang command has been deprecated.