Command line options for pg_upgrade v15
pg_upgrade
accepts the following command line options. Each option is available in a long form or a short form:
-b path_to_old_bin_directory
--old-bindir path_to_old_bin_directory
Use the -b
or --old-bindir
keyword to specify the location of the old cluster's executable directory.
-B path_to_new_bin_directory
--new-bindir path_to_new_bin_directory
Use the -B
or --new-bindir
keyword to specify the location of the new cluster's executable directory.
-c
--check
Include the -c
or --check
keyword to specify for pg_upgrade
to perform a consistency check on the old and new cluster without performing a version upgrade.
-d path_to_old_data_directory
--old-datadir path_to_old_data_directory
Use the -d
or --old-datadir
keyword to specify the location of the old cluster's data
directory.
-D path_to_new_data_directory
--new-datadir path_to_new_data_directory
Use the -D
or --new-datadir
keyword to specify the location of the new cluster's data
directory.
Data that's stored in user-defined tablespaces isn't copied to the new cluster. It stays in the same location in the file system but is copied into a subdirectory whose name reflects the version number of the new cluster. To manually relocate files that are stored in a tablespace after upgrading, you must move the files to the new location and update the symbolic links (located in the pg_tblspc
directory under your cluster's data
directory) to point to the files.
-j
--jobs
Include the -j
or --jobs
keyword to specify the number of simultaneous processes or threads to use during the upgrade.
-k
--link
Include the -k
or --link
keyword to create a hard link from the new cluster to the old cluster. See Linking versus copying for more information about using a symbolic link.
-o options
--old-options options
Use the -o
or --old-options
keyword to specify options to pass to the old postgres
command. Enclose options in single or double quotes to ensure that they're passed as a group.
-O options
--new-options options
Use the -O
or --new-options
keyword to specify options to pass to the new postgres
command. Enclose options in single or double quotes to ensure that they're passed as a group.
-p old_port_number
--old-port old_port_number
Include the -p
or --old-port
keyword to specify the port number of the EDB Postgres Advanced Server installation that you're upgrading.
-P new_port_number
--new-port new_port_number
Include the -P
or --new-port
keyword to specify the port number of the new EDB Postgres Advanced Server installation.
Note
If the original EDB Postgres Advanced Server installation is using port number 5444
when you invoke the EDB Postgres Advanced Server installer, the installer recommends using listener port 5445
for the new installation of EDB Postgres Advanced Server.
-r
--retain
During the upgrade process, pg_upgrade
creates four append-only log files. When the upgrade is completed, pg_upgrade
deletes these files. Include the -r
or --retain
option to retain the pg_upgrade
log files.
-U user_name
--username user_name
Include the -U
or --username
keyword to specify the name of the EDB Postgres Advanced Server database superuser. The same superuser must exist in both clusters.
-v
--verbose
Include the -v
or --verbose
keyword to enable verbose output during the upgrade process.
-V
--version
Use the -V
or --version
keyword to display version information for pg_upgrade
.
-?
-h
--help
Use -?
, -h,
or --help
options to display pg_upgrade
help information.