Initializing help system before first use

Upgrading to PostgreSQL 11

This topic contains the steps to upgrade your Red Hat Enterprise Linux database to PostgreSQL 11.
If you are migrating to PostgreSQL 11 from an older version you will need to check the encoding of the existing database first and if it differs from the default UTF8 encoding you will need to change the initdb command accordingly.
Note These are RHEL 7 commands. RHEL 6 users must translate the service commands into the old form.
  1. Make sure PostgreSQL 9.5 is running.
    systemctl status postgresql-9.5
  2. Check existing database encoding and collation:
    sudo -u postgres psql postgres -c 'SHOW server_encoding'
    sudo -u postgres psql postgres -c 'SHOW lc_collate'
    
  3. If the value returned by the server_encoding command is NOT UTF8 then adjust the initdb command. For example (assuming default data directory):
    # With custom collation (locale) and encoding
    sudo -u postgres /usr/pgsql-11/bin/initdb --locale C --encoding SQL_ASCII /var/lib/pgsql/11/data
    
  4. Stop PostgreSQL 9.5.
    systemctl stop postgresql-9.5
Note If you have configured an alternative PostgreSQL data directory then you will also need to use that alternative data directory in the initdb command.
# With alternative data directory
sudo -u postgres /usr/pgsql-11/bin/initdb --locale C --encoding SQL_ASCII /path/to/alternative/pgsql/data
After initializing the new PostgreSQL installation, follow the appropriate steps in the data migration guide. For more, see Migrating Data from Earlier Versions of Xpress Insight Server.