postgresql-setup man page

postgresql-setup — manual page for postgresql-setup 5.1

Synopsis

postgresql-setup MODE_OPTION [--unit=UNIT_NAME] [OPTION...]

Description

Script is aimed to help sysadmin with basic database cluster administration. Usually, "postgresql-setup --initdb" and "postgresql-setup --upgrade" is enough, however there are other options described below.

For more info and howto/when use this script please look at the documentation file /usr/share/doc/postgresql/README.rpm-dist.

Available operation mode

--initdb

Initialize new PostgreSQL database cluster.  This is usually the first action you perform after PostgreSQL server installation.

--upgrade

Upgrade database cluster for new major version of PostgreSQL server.  See the --upgrade-from option for more info.

Options

--unit=UNIT_NAME

The UNIT_NAME is used to select proper unit configuration (unit == service or initscript name on non-systemd systems).  For example, if you want to work with unit called 'postgresql@com_example.service', you should use 'postgresql@com_example' (without trailing .service string).  When no UNIT_NAME is explicitly passed, the 'postgresql' string is used by default.

--port=PORT

port where the initialized server will listen for connections

--datadir=PATH

Specify absolute path to DB data directory, only use with --new-systemd-unit.

--new-systemd-unit

Pre-generate system'd configuration in drop-in directory if the unit is not yet configured, requires non-default --unit specified and explicit --datadir and --port.

--upgrade-from-unit=UNIT

Select proper unit name to upgrade from.  This has similar semantics as --unit option.

--upgrade-ids

Print list of available IDs of upgrade scenarios to standard output.

--upgrade-from=ID

Specify id "old" postgresql stack to upgrade from.  List of available IDs can be listed by --upgrade-ids.  Default is 'postgresql'.

Other options

--help

show this help

--version

show version of this package

--debug

show basic debugging information

Environment

PGSETUP_INITDB_OPTIONS

Options carried by this variable are passed to subsequent call of `initdb` binary (see man initdb(1)).  This variable is used also during 'upgrade' mode because the new cluster is actually re-initialized from the old one.

PGSETUP_PGUPGRADE_OPTIONS

Options in this variable are passed next to the subsequent call of `pg_upgrade`.  For more info about possible options please look at man pg_upgrade(1).

PGSETUP_DEBUG

Set to '1' if you want to see very verbose shell debugging output.

Built against PostgreSQL version 10.0.

Info

October 2017 postgresql-setup 5.1 User Commands