Installing and configuring PostgreSQL database

Use the following instructions to install and configure PostgreSQL Database for use with HCL Commerce+.

Before you begin

You should have advanced knowledge of PostgreSQL Database (at the DBA level) before you change the database settings as recommended in this documentation.

For more information about the PostgreSQL Database, see https://www.postgresql.org/. You can obtain copies of the PostgreSQL documentation and software from the PostgreSQL Documentation website. The information on the present page is only as a guideline.

You can access PostgreSQL Database patches and patch sets at PostgreSQL Support.

PostgreSQL may require other file sets or components not installed by the operating system's default installation. Ensure you review the PostgreSQL Database documentation carefully and install any file sets or components that PostgreSQL requires.

Procedure

  1. Download the PostgreSQL installation package from the official website, at PostgreSQL Downloads.
    Select and download the appropriate version for your operating system (Linux, Windows, or macOS). The recommended version for HCL Commerce+ is PostgreSQL Version 18.3 or later.
  2. Run the installer and follow the instructions of installation wizard.
    During installation, configure the following settings:
    • Superuser Password: Set a strong password for the postgres superuser.

    • Port: Default is 5432. Ensure thatthis port is open and accessible.

    • Locale: Set according to system requirements.

  3. After installation, confirm that PostgreSQL is running by running the following command from the terminal.
    psql --version 
  4. Use the following configuration steps to enable PostgreSQL to use SSL with its connections.
    1. First, create an SSL certificate .
    2. Move the SSL Certificates to the PostgreSQL directory (for example, /etc/postgresql/ssl/ in a typical Linux installation).
    3. Using a text editor, update the following parameters in the postgresql.conf configuration file.
      ssl = on  
                    ssl_cert_file = '/etc/postgresql/ssl/server.crt'  
                    ssl_key_file = '/etc/postgresql/ssl/server.key'  
                    ssl_ca_file = '/etc/postgresql/ssl/root.crt'  # Optional: If you have a CA cert 
      
    4. Update the pg_hba.conf configuration file according to these requirements. By default, this file is located in the PostgreSQL data directory.
    5. Restart PostgreSQL.

Results

To access the PostgreSQL command-line interface (CLI), run the following command:
psql -U postgres