Installing EnterpriseDB (EDB) Postgres Advanced Server 18 (EPAS) on RHEL 10 – Redwood and Postgres Mode

EDB (EnterpriseDB) is one of the largest contributors to PostgreSQL and offers its own enterprise distributions on top of community PostgreSQL. The most prominent one is EDB Postgres Advanced Server (EPAS), which adds a large set of Oracle compatibility features (PL/SQL syntax, packages, Oracle data types and data dictionary views) as well as additional enterprise tooling. This makes EPAS a popular target for Oracle to Postgres migrations, but it can also be run as a “pure” Postgres server.

In this blog post, we will install EPAS 18 on a Red Hat Enterprise Linux 10 virtual machine. After the base installation we will create two database clusters: one in the Oracle-compatible Redwood mode (the default) and one in Postgres mode. Finally we will compare both modes with a few practical examples.

Prerequisites

RequirementDetails
Operating SystemRed Hat Enterprise Linux 10 (RHEL 10), installed as described in this post (Minimum 4GB RAM, 2 vCPUs, 30GB storage). According to the EDB platform compatibility page EPAS 18 is supported on RHEL 10/9/8.
EDB AccountA free EDB account. Signing up gives you a 60-day trial subscription to the EDB software repositories.
Root/Sudo AccessFull administrative privileges on the VM

Note on licensing: EPAS is commercial software. The trial subscription is intended for testing and evaluation only and must not be used for production workloads.

1. Base Installation

1.1 Get your EDB repository token

To download EDB software you need a repository token. After logging in to your EDB account, go to the EDB Repos 2.0 page and select Request Access on your first visit to generate the token. Copy the token and store it safely. Details are described in the EDB documentation.

1.2 Prepare the OS

EPAS needs some packages from EPEL and the CodeReady Builder repository:

# run as root
dnf -y update
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
dnf config-manager --set-enabled codeready-builder-for-rhel-10-x86_64-rpms

1.3 Add the EDB repository

The following commands add the EDB “enterprise” repository, which contains EPAS. Replace <your-token> with the token from step 1.1:

# run as root
export EDB_SUBSCRIPTION_TOKEN=<your-token>
curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/enterprise/setup.rpm.sh" | bash
# verify that the repository has been added
dnf repolist | grep enterprisedb
Sample Output (click to expand):
[root@lin8 ~]# export EDB_SUBSCRIPTION_TOKEN=xxx
[root@lin8 ~]# curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/enterprise/setup.rpm.sh" | bash
# verify that the repository has been added
dnf repolist | grep enterprisedb
Executing the  setup script for the 'enterprisedb/enterprise' repository ...

   OK: Checking for required executable 'curl' ...
   OK: Checking for required executable 'rpm' ...
   OK: Detecting your OS distribution and release using system methods ...
 ^^^^: ... Detected/provided for your OS/distribution, version and architecture:
 >>>>:
 >>>>: ... distro=rhel  version=10.3  codename=Coughlan  arch=x86_64
 >>>>:
   OK: Importing 'enterprisedb/enterprise' repository GPG keys into rpm ...
   OK: Checking for available package manager (DNF/Microdnf/YUM/Zypper) ...
 ^^^^: ... Detected package manager as 'dnf'
   OK: Checking for dnf dependency 'dnf-plugins-core' ...
   OK: Checking if upstream install config is OK ...
   OK: Fetching 'enterprisedb/enterprise' repository configuration ...
   OK: Installing 'enterprisedb/enterprise' repository via dnf ...
  RUN: Updating the dnf cache to fetch the new repository metadata ...Importing GPG key 0x9F1EF813:
 Userid     : "Cloudsmith Package (enterprisedb/enterprise) <support@cloudsmith.io>"
 Fingerprint: 31A4 CF09 0B3A E265 F131 58DE E71E B082 9F1E F813
 From       : https://downloads.enterprisedb.com/q35bgQwF1ncn0IKP0zdv3AX1cD81exPe/enterprise/gpg.E71EB0829F1EF813.key
Importing GPG key 0x9F1EF813:
 Userid     : "Cloudsmith Package (enterprisedb/enterprise) <support@cloudsmith.io>"
 Fingerprint: 31A4 CF09 0B3A E265 F131 58DE E71E B082 9F1E F813
 From       : https://downloads.enterprisedb.com/q35bgQwF1ncn0IKP0zdv3AX1cD81exPe/enterprise/gpg.E71EB0829F1EF813.key
Importing GPG key 0x9F1EF813:
 Userid     : "Cloudsmith Package (enterprisedb/enterprise) <support@cloudsmith.io>"
 Fingerprint: 31A4 CF09 0B3A E265 F131 58DE E71E B082 9F1E F813
 From       : https://downloads.enterprisedb.com/q35bgQwF1ncn0IKP0zdv3AX1cD81exPe/enterprise/gpg.E71EB0829F1EF813.key
   OK: Updating the dnf cache to fetch the new repository metadata ...
   OK: The repository has been installed successfully - You're ready to rock!

enterprisedb-enterprise                   enterprisedb-enterprise
enterprisedb-enterprise-noarch            enterprisedb-enterprise-noarch
enterprisedb-enterprise-source            enterprisedb-enterprise-source
[root@lin8 ~]#

If the curl command returns an error like curl: (22) The requested URL returned error: 404, check that you entered the correct token.

1.4 Install EPAS 18

# run as root
dnf -y install edb-as18-server
Sample Output (click to expand):
[root@lin8 ~]# # run as root
dnf -y install edb-as18-server
Updating Subscription Management repositories.
Extra Packages for Enterprise Linux 10 - x86_64                                                                                 3.4 MB/s | 7.3 MB     00:02
Red Hat CodeReady Linux Builder for RHEL 10 x86_64 (RPMs)                                                                       1.0 MB/s | 1.7 MB     00:01
Red Hat Enterprise Linux 10 for x86_64 - BaseOS (RPMs)                                                                          7.4 kB/s | 4.1 kB     00:00
Red Hat Enterprise Linux 10 for x86_64 - AppStream (RPMs)                                                                        13 kB/s | 4.1 kB     00:00
Dependencies resolved.
================================================================================================================================================================
 Package                                     Architecture             Version                            Repository                                        Size
================================================================================================================================================================
Installing:
 edb-as18-server                             x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                           12 k
Installing dependencies:
 edb-as18-server-client                      x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                          2.0 M
 edb-as18-server-contrib                     x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                          830 k
 edb-as18-server-core                        x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                          8.0 M
 edb-as18-server-docs                        x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                           21 k
 edb-as18-server-libs                        x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                          705 k
 edb-as18-server-plperl                      x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                           82 k
 edb-as18-server-plpython3                   x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                          113 k
 edb-as18-server-pltcl                       x86_64                   18.7.0-1.el10                      enterprisedb-enterprise                           51 k
 lz4                                         x86_64                   1.9.4-8.el10                       rhel-10-for-x86_64-baseos-rpms                   107 k
Installing weak dependencies:
 beacon-agent                                x86_64                   1.413.11-1                         enterprisedb-enterprise                           98 M

Transaction Summary
================================================================================================================================================================
Install  11 Packages

Total download size: 110 M
Installed size: 313 M
Downloading Packages:
(1/11): edb-as18-server-18.7.0-1.el10.x86_64.rpm                                                                                 31 kB/s |  12 kB     00:00
(2/11): edb-as18-server-client-18.7.0-1.el10.x86_64.rpm                                                                         1.6 MB/s | 2.0 MB     00:01
(3/11): edb-as18-server-contrib-18.7.0-1.el10.x86_64.rpm                                                                        748 kB/s | 830 kB     00:01
(4/11): edb-as18-server-docs-18.7.0-1.el10.x86_64.rpm                                                                            38 kB/s |  21 kB     00:00
(5/11): edb-as18-server-libs-18.7.0-1.el10.x86_64.rpm                                                                           553 kB/s | 705 kB     00:01
(6/11): edb-as18-server-core-18.7.0-1.el10.x86_64.rpm                                                                           3.6 MB/s | 8.0 MB     00:02
(7/11): edb-as18-server-plperl-18.7.0-1.el10.x86_64.rpm                                                                          84 kB/s |  82 kB     00:00
(8/11): edb-as18-server-plpython3-18.7.0-1.el10.x86_64.rpm                                                                      121 kB/s | 113 kB     00:00
(9/11): edb-as18-server-pltcl-18.7.0-1.el10.x86_64.rpm                                                                           69 kB/s |  51 kB     00:00
(10/11): lz4-1.9.4-8.el10.x86_64.rpm                                                                                            154 kB/s | 107 kB     00:00
(11/11): beacon-agent-1.413.11_linux_amd64.rpm                                                                                  9.0 MB/s |  98 MB     00:10
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                            10 MB/s | 110 MB     00:10
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                        1/1
  Installing       : edb-as18-server-libs-18.7.0-1.el10.x86_64                                                                                             1/11
  Running scriptlet: edb-as18-server-libs-18.7.0-1.el10.x86_64                                                                                             1/11
  Installing       : edb-as18-server-client-18.7.0-1.el10.x86_64                                                                                           2/11
  Running scriptlet: edb-as18-server-client-18.7.0-1.el10.x86_64                                                                                           2/11
  Installing       : edb-as18-server-contrib-18.7.0-1.el10.x86_64                                                                                          3/11
  Installing       : lz4-1.9.4-8.el10.x86_64                                                                                                               4/11
  Installing       : edb-as18-server-docs-18.7.0-1.el10.x86_64                                                                                             5/11
  Installing       : beacon-agent-1.413.11-1.x86_64                                                                                                        6/11
  Running scriptlet: edb-as18-server-core-18.7.0-1.el10.x86_64                                                                                             7/11
Creating group 'enterprisedb' with GID 976.
Creating user 'enterprisedb' (EDBAS User) with UID 976 and GID 976.

  Installing       : edb-as18-server-core-18.7.0-1.el10.x86_64                                                                                             7/11
  Running scriptlet: edb-as18-server-core-18.7.0-1.el10.x86_64                                                                                             7/11
  Installing       : edb-as18-server-plperl-18.7.0-1.el10.x86_64                                                                                           8/11
  Installing       : edb-as18-server-plpython3-18.7.0-1.el10.x86_64                                                                                        9/11
  Installing       : edb-as18-server-pltcl-18.7.0-1.el10.x86_64                                                                                           10/11
  Installing       : edb-as18-server-18.7.0-1.el10.x86_64                                                                                                 11/11
  Running scriptlet: edb-as18-server-18.7.0-1.el10.x86_64                                                                                                 11/11
Installed products updated.

Installed:
  beacon-agent-1.413.11-1.x86_64                      edb-as18-server-18.7.0-1.el10.x86_64               edb-as18-server-client-18.7.0-1.el10.x86_64
  edb-as18-server-contrib-18.7.0-1.el10.x86_64        edb-as18-server-core-18.7.0-1.el10.x86_64          edb-as18-server-docs-18.7.0-1.el10.x86_64
  edb-as18-server-libs-18.7.0-1.el10.x86_64           edb-as18-server-plperl-18.7.0-1.el10.x86_64        edb-as18-server-plpython3-18.7.0-1.el10.x86_64
  edb-as18-server-pltcl-18.7.0-1.el10.x86_64          lz4-1.9.4-8.el10.x86_64

Complete!
[root@lin8 ~]#

The installation creates the operating system user enterprisedb with the home directory /var/lib/edb/as18. The binaries are located in /usr/edb/as18/bin. In contrast to a community PostgreSQL installation no cluster has been created yet.

1.5 Customizing the enterprisedb OS user

Similar to the community PostgreSQL installation in this post we set a password and some useful settings for the OS user. The .bash_profile created by the package already sets PGDATA=/var/lib/edb/as18/data and sources the file /var/lib/edb/.enterprisedb_profile, which is not overwritten by RPM updates. Therefore we put our customizations there:

# run as root
echo 'enterprisedb:changeme'|chpasswd
usermod -a -G vboxsf enterprisedb
cat << 'EOF' >> /var/lib/edb/.enterprisedb_profile
PATH=/usr/edb/as18/bin:$PATH
export PATH
alias plog='tail -n 100 -F $(ls -tr $PGDATA/log/*log|tail -1)'
alias pcd='cd $PGDATA'
EOF
chown enterprisedb:enterprisedb /var/lib/edb/.enterprisedb_profile

2. EPAS in Redwood Mode (Oracle compatible)

When a cluster is initialized with the EDB setup script without further options, it is created in Redwood mode. This mode enables all Oracle compatibility features. The cluster contains a database named edb and the database superuser is named enterprisedb.

2.1 Initialize and start the cluster

# run as root
PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/edb/as18/bin/edb-as-18-setup initdb
systemctl enable edb-as-18
systemctl start edb-as-18
systemctl status edb-as-18
Sample Output (click to expand):
[root@lin8 ~]# # run as root
PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/edb/as18/bin/edb-as-18-setup initdb
systemctl enable edb-as-18
systemctl start edb-as-18
systemctl status edb-as-18
Initializing database ... OK

Created symlink '/etc/systemd/system/multi-user.target.wants/edb-as-18.service' → '/usr/lib/systemd/system/edb-as-18.service'.
● edb-as-18.service - EDB Postgres Advanced Server 18
     Loaded: loaded (/usr/lib/systemd/system/edb-as-18.service; enabled; preset: disabled)
     Active: active (running) since Mon 2026-11-23 16:03:24 CET; 19ms ago
 Invocation: 50c4d0eecf0148a7a3fef48097fdc3bb
    Process: 4516 ExecStartPre=/usr/edb/as18/bin/edb-as-18-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
   Main PID: 4525 (edb-postgres)
      Tasks: 12 (limit: 48389)
     Memory: 26.9M (peak: 26.9M)
        CPU: 63ms
     CGroup: /system.slice/edb-as-18.service
             ├─4525 /usr/edb/as18/bin/edb-postgres -D /var/lib/edb/as18/data
             ├─4527 "postgres: logger "
             ├─4528 "postgres: io worker 0"
             ├─4529 "postgres: io worker 1"
             ├─4530 "postgres: io worker 2"
             ├─4531 "postgres: checkpointer "
             ├─4532 "postgres: background writer "
             ├─4534 "postgres: walwriter "
             ├─4535 "postgres: autovacuum launcher "
             ├─4536 "postgres: dbms_aq launcher "
             └─4537 "postgres: logical replication launcher "

Nov 23 16:03:24 lin8.fritz.box systemd[1]: Starting edb-as-18.service - EDB Postgres Advanced Server 18...
Nov 23 16:03:24 lin8.fritz.box edb-postgres[4525]: 2026-11-23 16:03:24 CET LOG:  redirecting log output to logging collector process
Nov 23 16:03:24 lin8.fritz.box edb-postgres[4525]: 2026-11-23 16:03:24 CET HINT:  Future log output will appear in directory "log".
Nov 23 16:03:24 lin8.fritz.box systemd[1]: Started edb-as-18.service - EDB Postgres Advanced Server 18.
[root@lin8 ~]#

2.2 Allow connections from other hosts

To be able to connect from another system (e.g. pgAdmin 4 or DBeaver), the cluster needs to listen on all interfaces and allow remote connections:

# run as root
sed -i s/^"#listen_addresses = 'localhost'"/"listen_addresses = '*'"/g /var/lib/edb/as18/data/postgresql.conf
cat << EOF >> /var/lib/edb/as18/data/pg_hba.conf
# Allow connections from all other IPv4 hosts
host all all 0.0.0.0/0 scram-sha-256
EOF
systemctl restart edb-as-18
# set the password of the database superuser enterprisedb (changeme)
su - enterprisedb -c "psql -d edb -c \"alter user enterprisedb password 'changeme';\""

2.3 Verify the compatibility mode

The following query shows the dialect and the Redwood related parameters of the cluster:

# run as root
su - enterprisedb -c "psql -d edb -c \"select name, setting from pg_settings where name = 'db_dialect' or name like 'edb_redwood%' order by name;\""
Sample Output (click to expand):
[root@lin8 ~]# # run as root
su - enterprisedb -c "psql -d edb -c \"select name, setting from pg_settings where name = 'db_dialect' or name like 'edb_redwood%' order by name;\""
            name            | setting
----------------------------+---------
 db_dialect                 | redwood
 edb_redwood_date           | on
 edb_redwood_greatest_least | on
 edb_redwood_raw_names      | off
 edb_redwood_strings        | on
(5 rows)

[root@lin8 ~]#

2.4 Oracle compatibility in action

Now let’s run some typical Oracle SQL and PL/SQL in the edb database. First we connect with psql as the OS user enterprisedb:

# run as root
su - enterprisedb -c "psql -d edb"

We create a table with Oracle data types and a sequence:

CREATE TABLE emp_demo (
  empno    NUMBER(4) PRIMARY KEY,
  ename    VARCHAR2(10),
  job      VARCHAR2(9),
  hiredate DATE,
  sal      NUMBER(7,2),
  comm     NUMBER(7,2),
  deptno   NUMBER(2)
);
CREATE SEQUENCE emp_seq START WITH 7000;
INSERT INTO emp_demo VALUES (emp_seq.NEXTVAL, 'KING',  'PRESIDENT', SYSDATE, 5000, NULL, 10);
INSERT INTO emp_demo VALUES (emp_seq.NEXTVAL, 'BLAKE', 'MANAGER',   SYSDATE - 30, 2850, NULL, 30);
INSERT INTO emp_demo VALUES (emp_seq.NEXTVAL, 'ALLEN', 'SALESMAN',  ADD_MONTHS(SYSDATE, -12), 1600, 300, 30);

Typical Oracle functions and pseudo columns. After that we leave psql:

SELECT SYSDATE FROM DUAL;

SELECT ename,
       NVL(comm, 0) AS comm,
       DECODE(deptno, 10, 'ACCOUNTING', 30, 'SALES', 'OTHER') AS dept,
       TO_CHAR(hiredate, 'DD.MM.YYYY') AS hired
FROM   emp_demo
WHERE  ROWNUM <= 2;

-- leave psql
exit
Sample Output (click to expand):
[root@lin8 ~]# # run as root
su - enterprisedb -c "psql -d edb"
psql (18.7.0)
Type "help" for help.

edb=# CREATE TABLE emp_demo (
  empno    NUMBER(4) PRIMARY KEY,
  ename    VARCHAR2(10),
  job      VARCHAR2(9),
  hiredate DATE,
  sal      NUMBER(7,2),
  comm     NUMBER(7,2),
  deptno   NUMBER(2)
);
CREATE SEQUENCE emp_seq START WITH 7000;
INSERT INTO emp_demo VALUES (emp_seq.NEXTVAL, 'KING',  'PRESIDENT', SYSDATE, 5000, NULL, 10);
INSERT INTO emp_demo VALUES (emp_seq.NEXTVAL, 'BLAKE', 'MANAGER',   SYSDATE - 30, 2850, NULL, 30);
INSERT INTO emp_demo VALUES (emp_seq.NEXTVAL, 'ALLEN', 'SALESMAN',  ADD_MONTHS(SYSDATE, -12), 1600, 300, 30);
CREATE TABLE
CREATE SEQUENCE
INSERT 0 1
INSERT 0 1
INSERT 0 1
edb=# SELECT SYSDATE FROM DUAL;

SELECT ename,
       NVL(comm, 0) AS comm,
       DECODE(deptno, 10, 'ACCOUNTING', 30, 'SALES', 'OTHER') AS dept,
       TO_CHAR(hiredate, 'DD.MM.YYYY') AS hired
FROM   emp_demo
WHERE  ROWNUM <= 2;

-- leave psql
exit
      sysdate
--------------------
 23-NOV-26 16:20:20
(1 row)

 ename | comm |    dept    |   hired
-------+------+------------+------------
 KING  |    0 | ACCOUNTING | 23.11.2026
 BLAKE |    0 | SALES      | 24.10.2026
(2 rows)

[root@lin8 ~]#

Next we create a PL/SQL package and call it from an anonymous block using DBMS_OUTPUT.

Tip: When a PL/SQL package body is pasted into an interactive psql session, psql may split the code into several statements, which results in errors like syntax error at or near "*". Therefore we write the code into a file and run it with psql -f. Each PL/SQL block is terminated by a / on a line of its own.

# run as root
cat > /tmp/emp_pkg.sql << 'EOF'
CREATE OR REPLACE PACKAGE emp_pkg IS
  FUNCTION  get_salary(p_ename VARCHAR2) RETURN NUMBER;
  PROCEDURE raise_salary(p_ename VARCHAR2, p_pct NUMBER);
END emp_pkg;
/

CREATE OR REPLACE PACKAGE BODY emp_pkg IS
  FUNCTION get_salary(p_ename VARCHAR2) RETURN NUMBER IS
    v_sal emp_demo.sal%TYPE;
  BEGIN
    SELECT sal INTO v_sal FROM emp_demo WHERE ename = p_ename;
    RETURN v_sal;
  END get_salary;

  PROCEDURE raise_salary(p_ename VARCHAR2, p_pct NUMBER) IS
  BEGIN
    UPDATE emp_demo SET sal = sal * (1 + p_pct / 100) WHERE ename = p_ename;
    DBMS_OUTPUT.PUT_LINE('New salary of ' || p_ename || ': ' || get_salary(p_ename));
  END raise_salary;
END emp_pkg;
/

BEGIN
  DBMS_OUTPUT.PUT_LINE('Salary of KING: ' || emp_pkg.get_salary('KING'));
  emp_pkg.raise_salary('KING', 10);
END;
/
EOF
su - enterprisedb -c "psql -d edb -f /tmp/emp_pkg.sql"
Sample Output (click to expand):
[root@lin8 ~]# # run as root
cat > /tmp/emp_pkg.sql << 'EOF'
CREATE OR REPLACE PACKAGE emp_pkg IS
  FUNCTION  get_salary(p_ename VARCHAR2) RETURN NUMBER;
  PROCEDURE raise_salary(p_ename VARCHAR2, p_pct NUMBER);
END emp_pkg;
/

CREATE OR REPLACE PACKAGE BODY emp_pkg IS
  FUNCTION get_salary(p_ename VARCHAR2) RETURN NUMBER IS
    v_sal emp_demo.sal%TYPE;
  BEGIN
    SELECT sal INTO v_sal FROM emp_demo WHERE ename = p_ename;
    RETURN v_sal;
  END get_salary;

  PROCEDURE raise_salary(p_ename VARCHAR2, p_pct NUMBER) IS
  BEGIN
    UPDATE emp_demo SET sal = sal * (1 + p_pct / 100) WHERE ename = p_ename;
    DBMS_OUTPUT.PUT_LINE('New salary of ' || p_ename || ': ' || get_salary(p_ename));
  END raise_salary;
END emp_pkg;
/

BEGIN
  DBMS_OUTPUT.PUT_LINE('Salary of KING: ' || emp_pkg.get_salary('KING'));
  emp_pkg.raise_salary('KING', 10);
END;
/
EOF
su - enterprisedb -c "psql -d edb -f /tmp/emp_pkg.sql"
CREATE PACKAGE
CREATE PACKAGE BODY
psql:/tmp/emp_pkg.sql:26: Salary of KING: 5000.00
psql:/tmp/emp_pkg.sql:26: New salary of KING: 5500.00

EDB-SPL Procedure successfully completed
[root@lin8 ~]#

Finally we check the package in the Oracle compatible data dictionary view user_objects:

# run as root
su - enterprisedb -c "psql -d edb -c \"SELECT object_name, object_type, status FROM user_objects WHERE object_name = 'EMP_PKG';\""
Sample Output (click to expand):
[root@lin8 ~]# # run as root
su - enterprisedb -c "psql -d edb -c \"SELECT object_name, object_type, status FROM user_objects WHERE object_name = 'EMP_PKG';\""
 object_name | object_type  | status
-------------+--------------+--------
 EMP_PKG     | PACKAGE      | VALID
 EMP_PKG     | PACKAGE BODY | VALID
(2 rows)

[root@lin8 ~]#

3. EPAS in Postgres Mode

A cluster initialized with the option --no-redwood-compat runs in Postgres mode. It still contains the EPAS enterprise features, but the Oracle compatibility features are not enabled. According to the EDB documentation some features like Oracle style packages and collections are still available in this mode. Postgres mode is interesting if you want to use EPAS for new applications or migrations from other databases than Oracle.

We will create a second cluster on the same VM with its own data directory and port 5445.

3.1 Initialize the cluster

# run as root
mkdir -p /var/lib/edb/as18/data-pg
chown enterprisedb:enterprisedb /var/lib/edb/as18/data-pg
chmod 700 /var/lib/edb/as18/data-pg
# temporary password file for the superuser postgres (changeme)
echo 'changeme' > /tmp/pwfile && chown enterprisedb /tmp/pwfile
su - enterprisedb -c "/usr/edb/as18/bin/initdb --no-redwood-compat -D /var/lib/edb/as18/data-pg -U postgres -E UTF8 --auth-local=scram-sha-256 --auth-host=scram-sha-256 --pwfile=/tmp/pwfile"
rm -f /tmp/pwfile
# set the port and allow remote connections
cat << EOF >> /var/lib/edb/as18/data-pg/postgresql.conf
port = 5445
listen_addresses = '*'
EOF
cat << EOF >> /var/lib/edb/as18/data-pg/pg_hba.conf
# Allow connections from all other IPv4 hosts
host all all 0.0.0.0/0 scram-sha-256
EOF
Sample Output (click to expand):
[root@lin8 ~]# # run as root
mkdir -p /var/lib/edb/as18/data-pg
chown enterprisedb:enterprisedb /var/lib/edb/as18/data-pg
chmod 700 /var/lib/edb/as18/data-pg
# temporary password file for the superuser postgres (changeme)
echo 'changeme' > /tmp/pwfile && chown enterprisedb /tmp/pwfile
su - enterprisedb -c "/usr/edb/as18/bin/initdb --no-redwood-compat -D /var/lib/edb/as18/data-pg -U postgres -E UTF8 --auth-local=scram-sha-256 --auth-host=scram-sha-256 --pwfile=/tmp/pwfile"
rm -f /tmp/pwfile
# set the port and allow remote connections
cat << EOF >> /var/lib/edb/as18/data-pg/postgresql.conf
port = 5445
listen_addresses = '*'
EOF
cat << EOF >> /var/lib/edb/as18/data-pg/pg_hba.conf
# Allow connections from all other IPv4 hosts
host all all 0.0.0.0/0 scram-sha-256
EOF
The files belonging to this database system will be owned by user "enterprisedb".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are enabled.
Transparent data encryption is disabled.

fixing permissions on existing directory /var/lib/edb/as18/data-pg ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Europe/Berlin
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
loading edb contrib modules ...
dbms_aqadm_public.sql
dbms_aqadm.plb
dbms_aq_public.sql
dbms_aq.plb
edb_bulkload.sql
edb_gen.sql
edb_objects.sql
dblink_ora.sql
sys_stats.sql
ok
finalizing initial databases ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    /usr/edb/as18/bin/pg_ctl -D /var/lib/edb/as18/data-pg -l logfile start

[root@lin8 ~]#

3.2 Start the cluster

For a quick test we can start the cluster with pg_ctl:

# run as root
su - enterprisedb -c "pg_ctl -D /var/lib/edb/as18/data-pg -l /var/lib/edb/as18/data-pg/startup.log start"

(Optional) To start the cluster automatically with the OS, we can create a copy of the systemd unit of the first cluster:

# run as root
su - enterprisedb -c "pg_ctl -D /var/lib/edb/as18/data-pg stop"
cp /usr/lib/systemd/system/edb-as-18.service /etc/systemd/system/edb-as-18-pg.service
sed -i 's#/var/lib/edb/as18/data#/var/lib/edb/as18/data-pg#g; s#edb-as-18.pid#edb-as-18-pg.pid#g' /etc/systemd/system/edb-as-18-pg.service
systemctl cat edb-as-18-pg
systemctl daemon-reload
systemctl enable edb-as-18-pg --now

3.3 Verify the compatibility mode

# run as root
su - enterprisedb -c "PGPASSWORD=changeme psql -p 5445 -U postgres -d postgres -c \"select name, setting from pg_settings where name = 'db_dialect' or name like 'edb_redwood%' order by name;\""
Sample Output (click to expand):
[root@lin8 ~]# # run as root
su - enterprisedb -c "PGPASSWORD=changeme psql -p 5445 -U postgres -d postgres -c \"select name, setting from pg_settings where name = 'db_dialect' or name like 'edb_redwood%' order by name;\""
            name            | setting
----------------------------+----------
 db_dialect                 | postgres
 edb_redwood_date           | off
 edb_redwood_greatest_least | off
 edb_redwood_raw_names      | off
 edb_redwood_strings        | off
(5 rows)

[root@lin8 ~]#

3.4 Running the same tests in Postgres mode

Now we run the same tests against the new cluster. The table, sequence and queries from chapter 2.4 can be run interactively with su - enterprisedb -c "PGPASSWORD=changeme psql -p 5445 -U postgres -d postgres". The package file is run with su - enterprisedb -c "PGPASSWORD=changeme psql -p 5445 -U postgres -d postgres -f /tmp/emp_pkg.sql":

Sample Output (click to expand):
postgres=# CREATE TABLE emp_demo ( ... );
CREATE TABLE
CREATE SEQUENCE
ERROR:  column "sysdate" does not exist
LINE 1: ...mo VALUES (emp_seq.NEXTVAL, 'KING',  'PRESIDENT', SYSDATE, 5...
                                                             ^
ERROR:  column "sysdate" does not exist
LINE 1: ...mo VALUES (emp_seq.NEXTVAL, 'BLAKE', 'MANAGER',   SYSDATE - ...
                                                             ^
ERROR:  column "sysdate" does not exist
LINE 1: ...emp_seq.NEXTVAL, 'ALLEN', 'SALESMAN',  ADD_MONTHS(SYSDATE, -...
                                                             ^
postgres=# SELECT SYSDATE FROM DUAL;
ERROR:  relation "dual" does not exist
LINE 1: SELECT SYSDATE FROM DUAL;
                            ^
postgres=# SELECT ename, NVL(comm, 0) AS comm, DECODE(...) AS dept, TO_CHAR(...) AS hired FROM emp_demo WHERE ROWNUM <= 2;
 ename | comm | dept | hired
-------+------+------+-------
(0 rows)
[root@lin8 ~]# su - enterprisedb -c "PGPASSWORD=changeme psql -p 5445 -U postgres -d postgres -f /tmp/emp_pkg.sql"
CREATE PACKAGE
CREATE PACKAGE BODY
psql:/tmp/emp_pkg.sql:26: ERROR:  schema "dbms_output" does not exist
CONTEXT:  SQL statement "EXEC DBMS_OUTPUT.PUT_LINE('Salary of KING: ' || emp_pkg.get_salary('KING'))"
edb-spl function inline_code_block line 2 at procedure/function invocation statement
[root@lin8 ~]# su - enterprisedb -c "PGPASSWORD=changeme psql -p 5445 -U postgres -d postgres -c \"SELECT object_name, object_type, status FROM user_objects WHERE object_name = 'EMP_PKG';\""
ERROR:  relation "user_objects" does not exist
LINE 1: SELECT object_name, object_type, status FROM user_objects WH...
                                                     ^

The results show that Postgres mode is not simply “EPAS without Oracle compatibility”:

  • The Oracle data types NUMBER and VARCHAR2 are accepted.
  • The Oracle sequence syntax emp_seq.NEXTVAL works (tested separately with SELECT emp_seq.NEXTVAL;).
  • SYSDATE and the table DUAL do not exist, so the inserts and the first query fail.
  • The query with NVL, DECODE and ROWNUM runs without errors (it returns 0 rows because the inserts failed).
  • PL/SQL packages and anonymous blocks can be created and executed, but the built-in package DBMS_OUTPUT is not available.
  • The Oracle data dictionary views like USER_OBJECTS do not exist.

4. Redwood Mode vs. Postgres Mode at a Glance

Redwood ModePostgres Mode
initdb optiondefault (or --redwood-like)--no-redwood-compat
Default databaseedbpostgres
Database superuserenterprisedbpostgres
Default port in this setup54445445
Oracle data types (NUMBER, VARCHAR2)yesyes
Sequence syntax seq.NEXTVALyesyes
SYSDATE / DUALyesno
NVL / DECODE / ROWNUMyesyes
Oracle data dictionary views (USER_OBJECTS, …)yesno
PL/SQL packages and anonymous blocksyesyes
Built-in package DBMS_OUTPUTyesno
Database links to Oracle (dblink_ora)yesno (according to EDB docs)

Troubleshooting Common Issues

IssueSolution
curl returns error 404 when adding the repositoryCheck the EDB repository token.
EPAS cluster does not startCheck the logs: journalctl -u edb-as-18 and the log files in the data directory.
Second cluster does not startCheck that port 5445 is configured in postgresql.conf and not used by another process (ss -tlnp | grep 544).

Ressources

Conclusion

You have now installed EDB Postgres Advanced Server 18 on RHEL 10 and created two clusters: one in the Oracle compatible Redwood mode and one in Postgres mode. Here is a quick recap:

  • EPAS is installed from the EDB repositories using a (trial) subscription token.
  • The configuration mode is chosen when the cluster is initialized and cannot be changed later.
  • Redwood mode is the right choice for Oracle to Postgres migrations, Postgres mode for new applications and non-Oracle workloads.

Next Steps:

  • Set up high availability with EDB Failover Manager (EFM) or Patroni.
  • Monitor the clusters with Postgres Enterprise Manager (PEM).
  • Migrate an Oracle schema with the EDB Migration Toolkit.
  • Set up backups with Barman.
0