Installing PostgreSQL for Ubuntu

Use this task to install PostgreSQL for Ubuntu systems. The training server and stand-alone edge use a PostgreSQL database.

Procedure

  1. Install PostgreSQL, PHPPgadmin and Apache2 by using the following command:
    sudo apt-get -y install postgresql postgresql-contrib phppgadmin
  2. Configure the PostgreSQL user.
    1. Log in as the PostgreSQL user by using the following commands:
      sudo su
      su - postgres
      psql
    2. Configure the password for user postgres by using the following commands:
      password postgres
      password
      \q
  3. Configure Apache2 by editing the nano phppgadmin.conf file:
    cd /etc/apache2/conf-available/
    nano phppgadmin.conf
    Delete the following line: Require local. Add the following line to the file:
    Require all granted
  4. Configure the PHPPgadmin by editing the config.inc.php file:
    cd /etc/phppgadmin/
    nano config.inc.php
    Find the following line in the file:
    $conf['extra_login_security'] = true
    Change true to false.
  5. Restart PostreSQL and Apache2 by using the following commands:
    systemctl restart postgresql
    systemctl restart apache2
  6. Verify that you can access the user interface on the stand-alone edge by accessing the following URL:
    http://standalone_edge_IP/phppgadmin
    where standalone_edge_IP is the IP address of the stand-alone edge.
  7. Create the database schema in PostgreSQL.
    1. Run the following command on the SQL console on PHPPgadmin:
      create database edge with owner postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
    2. In the database, create the following tables:
      CREATE TABLE vi_tenant_inspectionresult(id text, info jsonb);
      CREATE TABLE vi_tenant_notification(id text, info jsonb);
      CREATE TABLE vi_tenant_defectsummary(id text, info jsonb);
      CREATE TABLE vi_tenant_uploaddataset(id text, info jsonb);
      CREATE TABLE vi_tenant_syncprocess(id text, info jsonb);
      CREATE TABLE vi_tenant_model(id text, info jsonb);
      CREATE TABLE vi_tenant_datagroup(id text, info jsonb);
      where tenant is the tenant for the operation user in the Maximo® PQI On-Premises Visual Insights center. Get the tenant value from the user profile in the user interface for the center application.