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:`Configuring PGD repositories <Configuring PGD 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.

EDB Postgres Advanced Server
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Debian/Ubuntu
'''''''''''''

.. code:: shell

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

CentOS/RHE
''''''''''

.. code:: shell

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

EDB Postgres Extended
^^^^^^^^^^^^^^^^^^^^^

.. _debianubuntu-1:

Debian/Ubuntu
'''''''''''''

.. code:: bash

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

CentOS/RHEL
'''''''''''

.. code:: bash

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

Community PostgreSQL
^^^^^^^^^^^^^^^^^^^^

.. _debianubuntu-2:

Debian/Ubuntu
'''''''''''''

.. code:: bash

   export EDB_PACKAGES="postgresql-$PG_VERSION edb-pgd6-expanded-pg$PG_VERSION"

.. _centosrhel-1:

CentOS/RHEL
'''''''''''

.. code:: bash

    export EDB_PACKAGES="postgresql$PG_VERSION-server postgresql$PG_VERSION-contrib edb-pgd6-expanded-pg$PG_VERSION"

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

Run the installation command appropriate for your platform.

.. _debianubuntu-3:

Debian/Ubuntu
^^^^^^^^^^^^^

.. code:: shell

   sudo apt install -y $EDB_PACKAGES

.. _centosrhel-2:

CentOS/RHEL
^^^^^^^^^^^

.. 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 on a CentOS/RHEL system using the repository configuration we set up
in the :ref:`Worked example <Worked example>`  .

.. code:: bash

   export PG_VERSION=17
   export EDB_PACKAGES="edb-as$PG_VERSION edb-pgd6-expanded-epas$PG_VERSION"
   sudo dnf install -y $EDB_PACKAGES
