Step 3 - Installing the database and pgd
========================================

On each host which you want to use as a PGD data node, you need to
install the database and the PGD software.

After you have :ref:`Step 2 - Configure repositories <Step 2 - Configure repositories>`  , you can install the database and PGD
software using your package manager.

Install the database and PGD software
-------------------------------------

Set the Postgres version
^^^^^^^^^^^^^^^^^^^^^^^^

Set an environment variable to specify the version of Postgres you want
to install. This is typically ``17`` for Postgres 17.

.. code:: bash

   export PG_VERSION=17

Set the package names
^^^^^^^^^^^^^^^^^^^^^

Set an environment variable to specify the package names for the
database and PGD software. The package names will vary depending on the
database you are using and the platform you are on.

.. code:: shell

   export EDB_PACKAGES="edb-as$PG_VERSION-server edb-pgd6-essential-epas$PG_VERSION"

.. code:: shell

   export EDB_PACKAGES="edb-as$PG_VERSION-server edb-pgd6-essential-epas$PG_VERSION"

.. code:: bash

     export EDB_PACKAGES="edb-postgresextended-$PG_VERSION edb-pgd6-essential-pgextended$PG_VERSION"

.. code:: bash

     export EDB_PACKAGES="edb-postgresextended$PG_VERSION-server edb-postgresextended$PG_VERSION-contrib edb-pgd6-essential-pgextended$PG_VERSION"

..  note Not available::
  

Community PostgreSQL is only operable with PGD Expanded.

.. ::
   </Tab>

Run the installation command
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Run the installation command appropriate for your platform.

.. code:: shell

   sudo apt install -y $EDB_PACKAGES

.. code:: shell

   sudo dnf install -y $EDB_PACKAGES

This command will install the specified packages and any dependencies
they require. Once the installation is complete, you will have the
database and PGD software installed on your system.

Worked example
--------------

In this example, we will install EDB Postgres Extended Server 17 with
PGD Essential on a CentOS/RHEL system using an enterprise subscription
using the repository confiuguration we set up in the :ref:`Worked example <Worked example>`  .

.. code:: bash

   export PG_VERSION=17
     export EDB_PACKAGES="edb-postgresextended$PG_VERSION-server edb-postgresextended$PG_VERSION-contrib edb-pgd6-essential-pgextended$PG_VERSION"
     sudo dnf install -y $EDB_PACKAGES

The next step is to :ref:`Step 4 - Configuring the cluster <Step 4 - Configuring the cluster>`  .
