pg-setup — set up a new Postgres Pro database cluster and manage the corresponding service
conf ] [
--enable-online-upgrade ] [
pg-setup is a shell script provided in the Postgres Pro distribution to automate database cluster setup on Linux systems. This script is provided as part of the
postgrespro-ent-13-server package. Once Postgres Pro is installed, you can find pg-setup in the
pg-setup must be run as root, but performs database administration operations as user
postgres. You can run this script with different options to:
initialize the database cluster
check for available ports and change the port used by Postgres Pro server
configure the database cluster for a specific Postgres Pro product
change server configuration parameters
enable/disable automatic startup of Postgres Pro service
start, stop, or restart Postgres Pro service
pg-setup accepts the following command-line arguments:
Initialize the database cluster on behalf of the
By default, the database cluster, configured for your Postgres Pro distribution, is initialized in the
/var/lib/pgpro/ent-13/datadirectory, with checksums enabled,
auth-localparameter set to
auth-hostparameter set to
md5. Localization settings are inherited from the
LANGenvironment variable for the current session. All the
LC_*environment variables are ignored. Optionally, you can provide initdb options to customize the installation.
If the default database is created using pg-setup, the path to its data directory is stored in the
/etc/default/postgrespro-enterprise-13file, so all the subsequent pg-setup commands, as well as any commands that manage Postgres Pro service, affect this database only. You cannot manage several databases using pg-setup.
Search for a free port on your system. This option is useful if you are going to install more than one server instance, or the default 5432 port is used by another program.
Specify the port number on which the server will listen for connections. Use this option to avoid conflicts if you are installing more than one server instance on the same system.
Set the specified configuration parameter to the provided
postgresql.conffile. If this parameter has been already defined by the
ALTER SYSTEMcommand, its previous value is removed from the
Manage Postgres Pro service using one of the following options:
enable— enable automatic service startup upon system restart.
disable— disable automatic service startup upon system restart.
start— start the service.
stop— stop the service.
condrestart— restart the service if it is running when pg-setup is invoked.
status— return the Postgres Pro service status.
Set the specified configuration for the database cluster. Predefined values of
confdepend on the Postgres Pro edition and can be
ent. The value of
1ccan be specified for any product. By default, the database cluster is configured for your Postgres Pro Enterprise edition. If you provide a value different from any predefined, the cluster will get non-customized configuration settings.
For systems where more than one database server and/or application will run, you may need to adjust the configuration since pg_setup chooses the configuration settings depending on hardware characteristics, assuming that the system will use only one database server.
Prepare the database cluster for minor version upgrades without a server restart. Such cluster could be upgraded later while staying online, i.e., no client connection would be interrupted during the installation of a new server version.
If you are installing Postgres Pro from the
postgrespro-ent-13 package, pg-setup is invoked automatically with the default settings. As a result, the database cluster is initialized and the default database is created in the
/var/lib/pgpro/ent-13/data directory, Postgres Pro service autostart is enabled, and the service is started.
If you are installing Postgres Pro server directly from the
postgrespro-ent-13-server package, you can run this script manually to initialize the database cluster or manage the Postgres Pro service.
For details on binary installation specifics on Linux, see Section 17.1.