Your company here — click to reach over 10,000 unique daily visitors

postgresql-setup - Man Page

manual page for postgresql-setup 8.9


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


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/postgresql16/README.rpm-dist.

Available operation mode


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


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



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 where the initialized server will listen for connections


We dropped this option for security reasons. Nowadays, please use the root-only script /usr/sbin/postgresql-new-systemd-unit.


Dropped with --new-systemd-unit.


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


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


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

Other options


show this help


show version of this package


show basic debugging information



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.


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).


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

Built against PostgreSQL version 16.3.


July 2024 postgresql-setup 8.9