Installing or Upgrading Pivotal Postgres
This topic describes how to download and install or upgrade components of the Pivotal Postgres software distribution. The Pivotal Postgres software components are provided in 3 downloadable packages:
- Postgres Server RPM – installs or upgrades all server and client components. This includes the PostgreSQL database, pgBackRest, Patroni,
psql
, and the ODBC driver. - Postgres Clients RPM – installs or upgrades only the client components,
psql
and the ODBC driver. - JDBC Driver for Pivotal Postgres – provides only the JDBC driver as a compressed ZIP file. This can be used on any machine as necessary for developing Java clients to PostgreSQL.
Prerequisites
- Your deployment systems must meet the system requirements described in Supported Platforms.
- You must have
root
permissions to install or upgrade the software. - Ensure that you have not installed Red Hat Enterprise Linux PostgreSQL on any system where you want to install Pivotal Postgres Server or Pivotal Postgres Clients. Pivotal Postgres software cannot be installed alongside RHEL PostgreSQL at this time.
Installing the Postgres Server RPM
Perform this procedure on each host that will run Pivotal Postgres. Note that this process also installs the psql
and ODBC driver client components to each machine:
Download the Pivotal Postgres Server RPM distribution from Pivotal Network. The Postgres Server download filename has the format:
pivotal-postgres-<postgres-version>-<pivotal-version>.<platform>.<architecture>.rpm
.Log in to your system as
root
, or usesudo
in the next step as necessary to acquireroot
privileges.Navigate to the downloaded RPM file and install it using the
yum
utility. For example:$ cd ~/Downloads $ yum install pivotal-postgres-10.10.3.el7.x86_64.rpm
If you are upgrading a running Postgres Server, restart the server. For exmple:
$ su postgres $ pg_ctl restart
If you are installing a new Postgres Server, continue to set up and start the server, as described in Server Setup and Operation in the PostgreSQL documentation.
Follow the instructions in Configuring and Using Pivotal Postgres to configure PostgreSQL with pgBackRest, Patroni, psqlODBC, and pgjdbc.
Installing the Pivotal Postgres Client RPM
Perform this procedure on each host that will act only as a client to the Pivotal Postgres instance.
Note: The Pivotal Postgres Client package is not required on Postgres Server machines, and you cannot install the client package on any machine that has a PostgreSQL server.
Download the Pivotal Postgres Client RPM distribution from Pivotal Network. The download filename has the format:
pivotal-postgres-clients-<postgres-version>.<pivotal-version>.<platform>.<architecture>.rpm
.Log in to your system as
root
, or usesudo
in the next step as necessary to acquireroot
privileges.Navigate to the downloaded RPM file and install it using the
yum
utility. For example:$ cd ~/Downloads $ yum install pivotal-postgres-clients-10.10.3.el7.x86_64.rpm
Continue to set up and start the PostgreSQL server, as described in Server Setup and Operation in the PostgreSQL documentation.
The Pivotal Postgres RPM installation creates the postgres user and sets the
PGDATA
environment variable in~postgres/.bash_profile
. It also creates the directory/var/lib/pgsql/data
, owned by the postgres user, which you can specify for the data directory when you initialize your PostgreSQL instance. This example initializes the data directory and starts the server:# su postgres $ source ~/.bash_profile $ initdb -D /var/lib/pgsql/data $ pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/data/logfile
Installing the Pivotal Postgres JDBC Driver
Download the Pivotal Postgres JDBC driver software distribution from Pivotal Network. The JDBC driver download filename has the format:
pivotal-postgres-<postgres-version>-jdbc-driver.zip
.Unzip the downloaded file to obtain the driver JAR file. For example:
$ unzip pivotal-postgres-10.10.3-jdbc-driver.zip
The JDBC driver JAR is not installed at the system level; simply include it in your Java
CLASSPATH
as necessary to connect using the driver. See Setting up the Class Path in the JDBC Driver documentation for more information.