postgresql_16:7.3.10.2 Options
PostgreSQL 16 > Reference > PostgreSQL Server Applications > pg_upgrade > Options
pg_upgrade accepts the following command-line arguments: -b *bindir* --old-bindir=*bindir* the old PostgreSQL executable directory; environment variable PGBINOLD -B *bindir* --new-bindir=*bindir* the new PostgreSQL executable directory; default is the directory where pg_upgrade resides; environment variable PGBINNEW -c --check check clusters only, don't change any data -d *configdir* --old-datadir=*configdir* the old database cluster configuration directory; environment variable PGDATAOLD -D *configdir* --new-datadir=*configdir* the new database cluster configuration directory; environment variable PGDATANEW -j *njobs* --jobs=*njobs* number of simultaneous processes or threads to use -k --link use hard links instead of copying files to the new cluster -N --no-sync By default, pg_upgrade will wait for all files of the upgraded cluster to be written safely to disk. This option causes pg_upgrade to return without waiting, which is faster, but means that a subsequent operating system crash can leave the data directory corrupt. Generally, this option is useful for testing but should not be used on a production installation. -o *options* --old-options *options* options to be passed directly to the old postgres command; multiple option invocations are appended -O *options* --new-options *options* options to be passed directly to the new postgres command; multiple option invocations are appended -p *port* --old-port=*port* the old cluster port number; environment variable PGPORTOLD -P *port* --new-port=*port* the new cluster port number; environment variable PGPORTNEW -r --retain retain SQL and log files even after successful completion -s *dir* --socketdir=*dir* directory to use for postmaster sockets during upgrade; default is current working directory; environment variable PGSOCKETDIR -U *username* --username=*username* cluster's install user name; environment variable PGUSER -v --verbose enable verbose internal logging -V --version display version information, then exit --clone Use efficient file cloning (also known as “reflinks” on some systems) instead of copying files to the new cluster. This can result in near-instantaneous copying of the data files, giving the speed advantages of -k/--link while leaving the old cluster untouched. File cloning is only supported on some operating systems and file systems. If it is selected but not supported, the pg_upgrade run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with reflink support), and on macOS with APFS. --copy Copy files to the new cluster. This is the default. (See also --link and --clone.) -? --help show help, then exit