![]() ![]() If your installation directory is not version-specific, e.g., /usr/local/pgsql, it is necessary to move the current PostgreSQL install directory so it does not interfere with the new PostgreSQL installation. The graphical installers all use version-specific installation directories. If you are using a version-specific installation directory, e.g., /opt/PostgreSQL/16, you do not need to move the old cluster. 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. If it is selected but not supported, the pg_upgrade run will error. This can result in near-instantaneous copying of the data files, giving the speed advantages of -k/ -link while leaving the old cluster untouched.įile cloning is only supported on some operating systems and file systems. Use efficient file cloning (also known as “ reflinks” on some systems) instead of copying files to the new cluster. Retain SQL and log files even after successful completion -s dirĭirectory to use for postmaster sockets during upgrade default is current working directory environment variable PGSOCKETDIR -U usernameĬluster's install user name environment variable PGUSER -vĭisplay version information, then exit -clone ![]() The new cluster port number environment variable PGPORTNEW -r The old cluster port number environment variable PGPORTOLD -P port ![]() ![]() Options to be passed directly to the new postgres command multiple option invocations are appended -p port Options to be passed directly to the old postgres command multiple option invocations are appended -O options Generally, this option is useful for testing but should not be used on a production installation. 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. Use hard links instead of copying files to the new cluster -Nīy default, pg_upgrade will wait for all files of the upgraded cluster to be written safely to disk. Number of simultaneous processes or threads to use -k The new database cluster configuration directory environment variable PGDATANEW -j njobs The old database cluster configuration directory environment variable PGDATAOLD -D configdir The new PostgreSQL executable directory default is the directory where pg_upgrade resides environment variable PGBINNEW -cĬheck clusters only, don't change any data -d configdir The old PostgreSQL executable directory environment variable PGBINOLD -B bindir Pg_upgrade supports upgrades from 9.2.X and later to the current major release of PostgreSQL, including snapshot and beta releases. It is important that any external modules are also binary compatible, though this cannot be checked by pg_upgrade. Pg_upgrade does its best to make sure the old and new clusters are binary-compatible, e.g., by checking for compatible compile-time settings, including 32/64-bit binaries. (The community will attempt to avoid such situations.) If a future major release ever changes the data storage format in a way that makes the old data format unreadable, pg_upgrade will not be usable for such upgrades. pg_upgrade uses this fact to perform rapid upgrades by creating new system tables and simply reusing the old user data files. Major PostgreSQL releases regularly add new features that often change the layout of the system tables, but the internal data storage format rarely changes. It is not required for minor version upgrades, e.g., from 12.7 to 12.8 or from 14.1 to 14.5. Pg_upgrade (formerly called pg_migrator) allows data stored in PostgreSQL data files to be upgraded to a later PostgreSQL major version without the data dump/restore typically required for major version upgrades, e.g., from 12.14 to 13.10 or from 14.9 to 15.5. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |