17.1. Installing Postgres Pro Enterprise on Linux

For Linux-based operating systems, Postgres Pro Enterprise is shipped as binary packages. Each Postgres Pro binary distribution consists of several packages, similar to native packaging of the PostgreSQL for these operating systems.

Splitting the distribution into several packages enables customizing the installation for different purposes: you can install Postgres Pro on database servers, client workstations, developer workstations for developing client applications, and so on. All Postgres Pro distributions include separate documentation packages in English and in Russian.

Depending on your target OS distribution, the available packages and installation specifics may differ. For more information, select your target OS family:

Regardless of the target OS, when initializing the cluster, make sure to specify all the parameters that are required for your environment. All the available initialization options are described in initdb documentation. In particular, note the following default settings you may want to override for your database cluster:

  • By default, when you initialize the cluster by running initdb, the trust authentication method is used for all connections, which is not recommended on production systems. For details on various authentication methods available, see Section 20.3.

  • The locale to be used is inherited from your system environment, which in turn affects the encoding, collation, and text search configuration that will be used for your cluster.

17.1.1. Installation on CentOS and Red Hat Enterprise Linux Systems

17.1.1.1. Choosing the Packages to Install

For Red Hat Enterprise Linux and its derivatives, such as CentOS, Oracle Linux, and Rosa Enterprise Linux Server, Postgres Pro distribution is split into the following packages:

Package Description
postgrespro-enterprise96 Standard client applications such as psql, pg_dump, and so on
postgrespro-enterprise96-libs Shared libraries, required to deploy client applications
postgrespro-enterprise96-serverPostgres Pro server and PL/pgSQL server-side programming language
postgrespro-enterprise96-contrib Additional extensions and programs deployable on database servers
pg-probackup-ent-9.6pg_probackup utility
postgrespro-enterprise96-pg_probackuppg_probackup package for automatic upgrades from Postgres Pro Enterprise 9.6.11.1 or lower
pg_repack Table reorganization utility
postgrespro-enterprise96-devel Development headers and libraries both for development of client applications and server extensions
postgrespro-enterprise96-plperl Server-side programming language based on Perl
postgrespro-enterprise96-plpython Server-side programming language based on Python
postgrespro-enterprise96-pltcl Server-side programming language based on Tcl
postgrespro-enterprise96-docs Documentation (English)
postgrespro-enterprise96-docs-ru Documentation (Russian)
postgrespro-enterprise96-test Test scripts for the server
pg-hint-plan-ent-9.6pg_hint_plan module

For server installations, install at least the following packages:

  • postgrespro-enterprise96-server

  • postgrespro-enterprise96

  • postgrespro-enterprise96-libs

To use additional Postgres Pro extensions, you must also install the postgrespro-enterprise96-contrib package.

By default, all files are installed into the /usr/pgproee-9.6 directory. Make sure /usr/pgproee-9.6/bin is added to your PATH environment variable.

17.1.1.2. Creating the Default Database

Installation of the postgrespro-enterprise96-server package does not create the default database. It only creates the postgres system user that owns database files and server processes.

To create the default database:

  • On SysVinit systems, such as Red Hat Enterprise Linux 6 and its derivatives, run the following command as root:

    service postgrespro-9.6 initdb
    

    The default database is created in the /var/lib/pgpro/9.6/data directory. To change the default directory, modify the corresponding setting in the /etc/sysconfig/pgsql/postgrespro-9.6 file.

  • On systemd-based systems, such as Red Hat Enterprise Linux 7 or CentOS 7, run the helper script pg-setup as root:

    /usr/pgproee-9.6/bin/pg-setup initdb
    

    In this case, the peer authentication method will be used for all local connections, while the ident method will be used for all network connections. For details on available authentication methods, see Section 20.3.

17.1.1.3. Installing Multiple Postgres Pro Instances

To run several instances of Postgres Pro server with different data directories, create a copy or a symlink of /etc/init.d/postgresql with a different name, create the corresponding /etc/sysconfig files and symlinks in runlevel directories.

If required, you can install vanilla PostgreSQL, Postgres Pro, and Postgres Pro Enterprise on the same system simultaneously.

The name of sysconfig file read by init.d script is derived from its own name.

17.1.2. Installation on Debian-Based Operating Systems

17.1.2.1. Choosing the Packages to Install

For Debian-based operating systems (Debian, Ubuntu, Astra Linux), Postgres Pro is split into following packages:

Package Description
postgrespro-libecpg6 Runtime libraries for ECPG preprocessor
postgrespro-libecpg-compat3 Compatibility runtime for programs compiled with old ECPG
postgrespro-libecpg-dev ECPG preprocessor for embedded SQL
postgrespro-libpgtypes3 Runtime libpgtypes library for programs build with ECPG
postgrespro-libpq5 Runtime libraries for Postgres client programs
postgrespro-libpq-dev Development files for develop client programs
postgrespro-9.6Postgres Pro server
postgrespro-9.6-dbg Debug information for Postgres Pro server
postgrespro-client-9.6 Client programs for interaction with Postgres Pro server
postgrespro-common-9.6 Tools for managing multiple server instances
postgrespro-client-common-9.6 Tools for choosing between different versions of client programs installed on one system
postgrespro-contrib-9.6 Additional modules and extensions
postgrespro-doc-9.6 Documentation (English)
postgrespro-doc-ru-9.6 Documentation (Russian)
pg-probackup-ent-9.6pg_probackup utility
postgrespro-pg-probackup-9.6pg_probackup package for automatic upgrades from Postgres Pro Enterprise 9.6.11.1 or lower
postgrespro-plperl-9.6 Server-side PL/Perl language
postgrespro-plpython3-9.6 Server-side PL/Python language based on Python 3
postgrespro-plpython-9.6 Server-side PL/Python language based on Python 2
postgrespro-pltcl-9.6 Server-side PL/Tcl language
postgrespro-server-dev-9.6 Development files to compile server extensions using PGXS framework
pg-hint-plan-ent-9.6pg_hint_plan module

Server installations require postgrespro-9.6 package (which depends on postgrespro-contrib-9.6). Other server-related packages, such as the ones for PL languages or pg_probackup, are optional.

Client installations need only postgrespro-libpq5 and postgrespro-client-9.6 packages. If you use custom applications and do not need standard clients such as psql, you can install the postgrespro-libpq5 package only.

Development files on Debian are split into the following packages:

  • postgrespro-libpq-dev — development package for compiling client programs.

  • postgrespro-libecpg-dev — development package for programs that use ECPG Embedded SQL preprocessor.

  • postgrespro-server-dev-9.6 — development package for compiling server extensions.

17.1.2.2. Creating the Default Database

Debian database server packages create the default database at the moment of server installation, and allow to create additional ones, called clusters using pg_createcluster script. All these clusters are managed using system service management facilities (SysVinit in older distributions, systemd in newer ones).

pg_createcluster also allows to import existing databases into Debian-specific service management system. It tries to automatically enable SSL on the newly created cluster, but can do so only if the postgres user is a member of ssl-cert group and there is valid certificate in /etc/ssl/certs.

Postgres Pro distribution for Debian-based systems uses a non-standard directory layout for the database cluster. By default, Postgres Pro keeps configuration files and data in the same directory. However, Debian policy requires configuration files to be stored under /etc. Thus, on Debian-based systems, the PGDATA parameter always points to a subdirectory under /etc, where only postgresql.conf, pg_hba.conf and a few other configuration files are stored. The actual location of data is determined by the data_directory option in postgresql.conf.

17.1.2.3. Installing Multiple Postgres Pro Instances

The postgrespro-common and postgrespro-client-common packages provide a complex infrastructure that allows running several versions of PostgreSQL, Postgres Pro and Postgres Pro Enterprise servers simultaneously, thus enabling smooth database upgrades.

For more information about Debian-specific infrastructure, see the following manual pages: pg_createcluster(8), pg_ctlcluster(8), pg_conftool(1), postgresql-common(5), postgresqlrc(5) and user_clusters(5).

Debian provides the script pg_wrapper(1) to invoke client binaries for correct version of your PostgreSQL-based product. It is linked as /usr/bin/psql, /usr/bin/pg_dump, etc. If several PostgreSQL-based products are installed, it invokes the most recent binaries unless explicitly configured to do the opposite.

Note

Debian packaging of Postgres Pro programs contains two copies of the pg_config utility, one in the libpq-dev package and the other in postgrespro-server-dev-9.6 package. It is because both client programs and server extensions use this utility to determine location of Postgres development files. So, if you are planning to develop both client applications and server extensions on same system, make sure that you have installed libpq-dev and postgrespro-server-dev-X.X from same Postgres product.

17.1.3. Installation on ALT Linux

17.1.3.1. Choosing the Packages to Install

For ALT Linux, Postgres Pro is split into the following packages:

Package Description
libecpg6.8 Runtime libraries for programs using ECPG
libecpg6.8-devel ECPG embedded SQL preprocessor
libecpg6.8-devel-static Static libraries for ECPG
libpq5.9 Client library libpq
libpq5.9-devel Development files for libpq
libpq5.9-devel-static Static libraries for compiling client programs
postgrespro-enterprise9.6 Standard client programs, such as psql, and man pages for SQL commands
postgrespro-enterprise9.6-contrib Extensions loadable into Postgres Pro server
postgrespro-enterprise9.6-devel Files to compile server extensions using PGXS framework
postgrespro-enterprise9.6-devel-static Static libraries needed to compile extensions
postgrespro-enterprise9.6-docs Documentation (English)
postgrespro-enterprise9.6-docs-ru Documentation (Russian)
postgrespro-enterprise9.6-perl PL/Perl programming language
pg-probackup-ent-9.6pg_probackup utility
postgrespro-enterprise9.6-pg_probackuppg_probackup package for automatic upgrades from Postgres Pro Enterprise 9.6.11.1 or lower
postgrespro-enterprise9.6-python PL/Python programming language
postgrespro-enterprise9.6-server Postgres Pro Enterprise server
postgrespro-enterprise9.6-tcl PL/Tcl programming language
pg-hint-plan-ent-9.6pg_hint_plan module

All packages containing binary files have the corresponding -debuginfo packages.

For server installations, you need postgrespro-enterprise9.6-server. For a minimal client installation, only the libpq5.9 package is required. postgrespro-enterprise9.6 is typically needed on clients.

pg_config utility is only shipped as part of postgrespro-enterprise9.6-devel package, so you need to install this package if you are going to compile client programs that use pg_config in the build process.

17.1.3.2. Installing Multiple Postgres Pro Instances

On ALT Linux, you can only have a single PostgreSQL installation on your system at a time. If you are installing a newer version over the old one, new binaries replace the old ones. To perform database upgrade using pg_upgrade utility, you need both new and old postgres executable files. So, pre-installation script copies the existing postgres binary and libpq shared library into /usr/lib64/pgsql/9.6/backup. Use this directory name as an argument of the pg_upgrade -b option.

17.1.4. Installation on the SUSE Linux

17.1.4.1. Choosing the Packages to Install

For SUSE systems, Postgres Pro is split into following packages:

Package Description
libecpg6 Runtime libraries for programs using ECPG
libpq5 Runtime libraries for Postgres client programs
postgrespro-enterprise96 Standard client programs, such as psql, and man pages for SQL commands
postgrespro-enterprise96-contrib Loadable modules and extensions for server
postgrespro-enterprise96-devel Development files for both client programs and server extensions
postgrespro-enterprise96-docs Documentation (English)
postgrespro-enterprise96-docs-ru Documentation (Russian)
pg-probackup-ent-9.6pg_probackup utility
postgrespro-enterprise96-pg_probackuppg_probackup package for automatic upgrades from Postgres Pro Enterprise 9.6.11.1 or lower
postgrespro-enterprise96-plperl PL/Perl programming language
postgrespro-enterprise96-plpython PL/Python programming language
postgrespro-enterprise96-pltcl PL/Tcl programming language
postgrespro-enterprise96-serverPostgres Pro server
postgrespro-enterprise96-test Regression test suite for Postgres Pro server
pg-hint-plan-ent-9.6pg_hint_plan module

Server installations require postgrespro-enterprise96-server, postgrespro-enterprise96, and postgrespro-enterprise96-libs packages. To use additional Postgres Pro extensions, you must also install the postgrespro-enterprise96-contrib package.

17.1.4.2. Creating the Default Database

To start Postgres Pro server after installation of the server package, run the following command as root:

service postgresql start

The default database in SUSE is created upon the first start of service. You can customize its location, locale, and other parameters in /etc/sysconfig/postgrespro.

17.1.4.3. Installing Multiple Postgres Pro Instances

On SUSE systems, you cannot install several versions of client programs simultaneously.