Initializing help system before first use

Specifying an Alternative PostgreSQL Data Directory on RHEL

The default data directory for PostgreSQL 11. 10 is /var/lib/pgsql/11/data. If you do not need to change the directory, skip this topic.
Note These are RHEL 7 commands. RHEL 6 users must translate the service commands into the old form.
Important The steps below use the example alternative directory in the following steps is /external-vol/pgdata-11.10.
  1. Perform the following steps:
    • RHEL 7:
      1. Create and edit /etc/systemd/system/postgresql-11.service.
      2. Add the following content:
        .include /lib/systemd/system/postgresql-11.service
        [Service]
        Environment=PGDATA=/external-vol/pgdata-11.10
      3. Reload the Systemd configuration:
        systemctl daemon-reload
  2. Set the PGDATA environment variable to point to the custom data directory. This is necessary for the Xpress Insight Server installer to find the custom data directory: export PGDATA="/external-vol/pgdata-11.10"