Installing EDB Postgres Advanced Server on AlmaLinux 8 or Rocky Linux 8 x86_64 v15

Prerequisites

Before you begin the installation process:

  • Set up the repository Setting up the repository is a one-time task. If you have already set up your repository, you do not need to perform this step.

    To set up the repository, go to EDB repositories and follow the instructions provided there.

  • Install the EPEL repository

    sudo dnf -y install epel-release
  • Enable additional repositories to resolve dependencies

    sudo dnf config-manager --set-enabled powertools

Install the package

sudo dnf -y install edb-as<xx>-server

Where <xx> is the version of the EDB Postgres Advanced server you are installing. For example, if you are installing version 15, the package name would be edb-as15-server.

To install an individual component:

sudo dnf -y install <package_name>

Where package_name can be any of the available packages from the available package list.

Installing the server package creates an operating system user named enterprisedb. The user is assigned a user ID (UID) and a group ID (GID). The user has no default password. Use the passwd command to assign a password for the user. The default shell for the user is bash and the user's home directory is /var/lib/edb/as15.

Initial configuration

This section steps you through getting started with your cluster including logging in, ensuring the installation and initial configuration was successful, connecting to your cluster, and creating the user password.

# Initialize the database cluster
PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/edb/as15/bin/edb-as-15-setup initdb

# Start the database cluster
systemctl start edb-as-15

# To work in your cluster, login as the enterprisedb user
su - enterprisedb

# Connect to the database server using the psql command line client
psql edb

# Assign a password to the database superuser the enterprisedb
ALTER ROLE enterprisedb IDENTIFIED BY password;

# Create a database (named hr)
CREATE DATABASE hr;

# Connect to the new database and create a table (named dept)
\c hr
CREATE TABLE public.dept (deptno numeric(2) NOT NULL CONSTRAINT dept_pk
PRIMARY KEY, dname varchar(14) CONSTRAINT dept_dname_uq UNIQUE, loc
varchar(13));

# Add data to the table
INSERT INTO dept VALUES (10,'ACCOUNTING','NEW YORK');
INSERT into dept VALUES (20,'RESEARCH','DALLAS');

# You can use simple SQL commands to query the database and retrieve
# information about the data you have added to the table
SELECT * FROM dept;
Output
deptno  |   dname    |   loc
--------+------------+----------
10      | ACCOUNTING | NEW YORK
20      | RESEARCH   | DALLAS
(2 rows)