Use this procedure to upgrade PostgreSQL 16 to PostgreSQL 18 after upgrading Compliance Manager Vault and Policy Agent to version 10.6.1.


  1. Back up all databases:
    postgres pg_dumpall > all_databases_backup.sql
  2. Refresh the package list on your Linux system as a root user:
    sudo apt update
  3. Install PostgreSQL 18:
    sudo apt install -y postgresql-18 postgresql-contrib-18
  4. Check the running PostgreSQL clusters:
    pg_lsclusters

    The expected setup is PostgreSQL 16 main on port 5432 and PostgreSQL 18 main on an alternate port, typically 5433. 

  5. Link the Entrust library and extension files for PostgreSQL 18:
    sudo ln -s /opt/hcs/lib/entrust_psql_extension_18.so /usr/lib/postgresql/18/lib/entrust_psql_extension.so
    sudo ln -s /usr/share/postgresql/16/extension/entrust_psql_extension.control /usr/share/postgresql/18/extension/
    sudo ln -s /usr/share/postgresql/16/extension/entrust_psql_extension--*.sql /usr/share/postgresql/18/extension/
  6. Upgrade the PostgreSQL 16 main cluster:
    sudo pg_upgradecluster 16 main
  7. In psql, ensure the extension is installed:
    CREATE EXTENSION IF NOT EXISTS entrust_psql_extension;
  8. Open the session:
    select open_session('file:///opt/hcs/etc/psql.conf');
  9. Fetch the key again:
    select get_key('masterkey') as handle \gset
  10. Decrypt the data:
    select name, decrypt_data(credit_card_details) from new;