Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_upgradecluster(8) [debian man page]

PG_UPGRADECLUSTER(8)					 Debian PostgreSQL infrastructure				      PG_UPGRADECLUSTER(8)

NAME
pg_upgradecluster - upgrade an existing PostgreSQL cluster to a new major version. SYNOPSIS
pg_upgradecluster [-v newversion] version name [newdatadir] DESCRIPTION
pg_upgradecluster upgrades an existing PostgreSQL server cluster (i. e. a collection of databases served by a postmaster instance) to a new version specified by newversion (default: latest available version). The configuration files of the old version are copied to the new cluster. The cluster of the old version will be configured to use a previously unused port since the upgraded one will use the original port. The old cluster is not automatically removed. After upgrading, please verify that the new cluster indeed works as expected; if so, you should remove the old cluster with pg_dropcluster(8). Please note that the old cluster is set to "manual" startup mode, in order to avoid inadvertently changing it; this means that it will not be started automatically on system boot, and you have to use pg_ctlcluster(8) to start/stop it. See section "STARTUP CONTROL" in pg_createcluster(8) for details. The newdatadir argument can be used to specify a non-default data directory of the upgraded cluster. It is passed to pg_createcluster. If not specified, this defaults to /var/lib/postgresql/version/name. Please note that this program cannot upgrade clusters which use tablespaces. If you use those, you have to upgrade manually. OPTIONS
-v newversion Set the version to upgrade to (default: latest available). --logfile filel Set a custom log file path for the upgraded database cluster. --locale=locale Set the default locale for the upgraded database cluster. If this option is not specified, the locale is inherited from the old cluster. --lc-collate=locale --lc-ctype=locale --lc-messages=locale --lc-monetary=locale --lc-numeric=locale --lc-time=locale Like --locale, but only sets the locale in the specified category. HOOK SCRIPTS
Some PostgreSQL extensions like PostGIS need metadata in auxiliary tables which must not be upgraded from the old version, but rather initialized for the new version before copying the table data. For this purpose, extensions (as well as administrators, of course) can drop upgrade hook scripts into /etc/postgresql-common/pg_upgradecluster.d/. Script file names must consist entirely of upper and lower case letters, digits, underscores, and hyphens; in particular, dots (i. e. file extensions) are not allowed. Scripts in that directory will be called with the following arguments: <old version> <cluster name> <new version> <phase> Phases: init A virgin cluster of version new version has been created, i. e. this new cluster will already have template1, but no user databases. Please note that you should not create tables in this phase, since they will be overwritten by the dump/restore operation. finish All data from the old version cluster has been dumped/reloaded into the new one. The old cluster still exists. The scripts are called as the user who owns the database. SEE ALSO
pg_createcluster(8), pg_dropcluster(8), pg_lsclusters(1), pg_wrapper(1) AUTHOR
Martin Pitt <mpitt@debian.org> Debian 2012-10-08 PG_UPGRADECLUSTER(8)

Check Out this Related Man Page

PG_WRAPPER(1)						 Debian PostgreSQL infrastructure					     PG_WRAPPER(1)

NAME
pg_wrapper - wrapper for PostgreSQL client commands SYNOPSIS
client-program [--cluster version/cluster] [...] (client-program: psql, createdb, dropuser, and all other client programs installed in /usr/lib/postgresql/version/bin). DESCRIPTION
This program is run only as a link to names which correspond to PostgreSQL programs in /usr/lib/postgresql/version/bin. It determines the configured cluster and database for the user and calls the appropriate version of the desired program to connect to that cluster and database, supplying any specified options to that command. The target cluster is selected by the following means, in descending order of precedence: 1. explicit specification with the --host option 2. explicit specification with the --cluster option 3. if the PGHOST environment variable is set, no further cluster selection is performed. The default PostgreSQL version and port number (from the command line, the environment variable PGPORT, or default 5432) will be used. 4. explicit specification with the PGCLUSTER environment variable 5. matching entry in ~/.postgresqlrc (see postgresqlrc(5)), if that file exists 6. matching entry in /etc/postgresql-common/user_clusters (see user_clusters(5)), if that file exists 7. If only one local cluster exists, that one will be selected. 8. If several local clusters exist, the one listening on the default port 5432 will be selected. If none of these rules match, pg_wrapper aborts with an error. OPTIONS
--cluster version/cluster cluster is either the name of a local cluster, or takes the form host:port for a remote cluster. If port is left empty (i. e. you just specify host:), it defaults to 5432. ENVIRONMENT
PGCLUSTER If $PGCLUSTER is set, its value (of the form version/cluster) specifies the desired cluster, similar to the --cluster option. However, if --cluster is specified, it overrides the value of $PGCLUSTER. PG_CLUSTER_CONF_ROOT This specifies an alternative base directory for cluster configurations. This is usually /etc/postgresql/, but for testing/development purposes you can change this to point to e. g. your home directory, so that you can use the postgresql-common tools without root privileges. FILES
/etc/postgresql-common/user_clusters stores the default cluster and database for users and groups as set by the administrators. $HOME/.postgresqlrc stores defaults set by the user himself. SEE ALSO
user_clusters(5), postgresqlrc(5) AUTHOR
Martin Pitt <mpitt@debian.org> Debian 2013-01-04 PG_WRAPPER(1)
Man Page