Initializing help system before first use

Configuring PostgreSQL on RHEL

Configure PostgreSQL by storing the database files in an alternative location, initializing the data directory, setting the database service to start on boot, and start the database service.
Note These are RHEL 7 commands. RHEL 6 users must translate the service commands into the old form.
  1. (Optional) If you want to store database files in an alternative location follow the steps in the section Specifying an Alternative PostgreSQL Data Directory on RHEL .
  2. (Optional) If you are migrating to PostgreSQL 11 from an older version follow the steps in the section Upgrading to PostgreSQL 11.
  3. Initialize the PostgreSQL data directory:
    sudo -u postgres /usr/pgsql-11/bin/initdb --encoding UTF8 /var/lib/pgsql/11/data
  4. Set the database service to start on boot: chkconfig postgresql-11 on
  5. If you are migrating from PostgreSQL 9.5, you will need to stop the old version before proceeding to the next step.
    systemctl stop postgresql-9.5
    systemctl disable postgresql-9.5
  6. Start the database service:
    systemctl enable postgresql-11
    systemctl start postgresql-11