pgpro_upgrade
pgpro_upgrade — upgrade a Postgres 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 the Postgres Pro distribution to facilitate Postgres Pro upgrades to minor update versions based on the same PostgreSQL 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 the PGDATA 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
For Postgres 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 your Postgres Pro installation from a binary package, the pgpro_upgrade script is run automatically, unless you are prompted to run it manually. If you have compiled Postgres Pro from source code or created your database in a non-default location, you must run the pgpro_upgrade script manually.
By default, pgpro_upgrade is located in , where install-dir/bin is the Postgres Pro installation directory. To manually run install-dirpgpro_upgrade, follow this procedure:
Stop the
postgresservice.Install the new Postgres 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 run pgpro_upgrade using wrapper provided for convenience. This wrapper launches the install-dir/scripts/pgpro_upgrade.cmdpgpro_upgrade script for the default database cluster, without taking any arguments.