pgpro_upgrade
pgpro_upgrade — upgrade aPostgres Pro database cluster to a minor update version
Synopsis
pgpro_upgrade [{-D |--pgdata } directory] [--check ]
pgpro_upgrade [--help ]
Description
pgpro_upgrade is a shell script provided in thePostgres Pro distribution to facilitatePostgres Pro upgrades to minor update versions based on the samePostgreSQL major version. This script checks whether the new version introduces any system catalog changes and adds the corresponding features into the catalog of the existing database cluster. When run without any options,pgpro_upgrade upgrades the cluster specified in thePGDATA environment variable.
Options
pgpro_upgrade accepts the following command-line arguments:
-Ddirectory--pgdatadirectorySpecify the data directory of the database cluster to be upgraded. By default,pgpro_upgrade upgrades the cluster specified in the
PGDATAenvironment variable.--checkCheck whether the specified database cluster needs to be upgraded, without changing any data. Return values are:
0 if no changes are required.
1 if the cluster needs to be upgraded.
-h--helpShow help, then exit.
Usage
ForPostgres Pro minor updates that introduce any system catalog changes as compared to the previous version,pgpro_upgrade must be run to update system catalogs after installing such updates. If you are upgrading yourPostgres Pro installation from a binary package, thepgpro_upgrade script is run automatically, unless you are prompted to run it manually. If you have compiledPostgres Pro from source code or created your database in a non-default location, you must run thepgpro_upgrade script manually.
By default,pgpro_upgrade is located in, whereinstall-dir/bin is thePostgres Pro installation directory. To manually runinstall-dirpgpro_upgrade, follow this procedure:
Stop the
postgresservice.Install the newPostgres Pro version into your current installation directory.
On behalf of the system user owning the database, run the
pgpro_upgradescript with the-Doption specifying the database cluster to upgrade:install-dir/bin/pgpro_upgrade -DdirectoryThe script checks whether any changes are needed and updates the system catalogs accordingly, if required.
Note
On Windows systems, you can also runpgpro_upgrade using wrapper provided for convenience. This wrapper launches theinstall-dir/scripts/pgpro_upgrade.cmdpgpro_upgrade script for the default database cluster, without taking any arguments.