HAKOM PowerTSM® Documentation

PostgreSQL

Requirements

A list of supported PostgreSQL Versions can be found here: System Requirements

Depending on whether a new HAKOM database is to be created or an existing one is to be updated, please refer to the sections below. 

Path to install package

All neccessary scripts for PostgreSQL can be found under the following path: Database Scripts\PostgreSQL


Linux Environments

PowerShell Core has to be installed according to the corresponding documentation for the Linux distribution currently in use: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux

Configuration.ini

To use installation/update powershell scripts a valid configuration.ini must be provided. This file can be found in folder Database Scripts\PostgreSQL. Use a text editor to configure the ServerConfiguration and DatabaseConfiguration sections.

The parameters under SchemaConfiguration should not be changed!


Meaning of Parameters


ServerConfiguration

Meaning

dbhost

Name of the server on which PostgreSQL is running

dbport

Port of the server running PostgreSQL

usersuffix

Optional suffix to be appended to usernames during login/connect operations (i.e. "@hostname")

dbadmin;

PGPASSWORD

Name and password of the user with admin rights

dbadmindatabase

Database of the dbadmin (needed for connection when creating a new database or user)


DatabaseConfiguration

Meaning

dbname

Name of the database to be edited.

If create_db = true, this is the name the new database will have.

dbowner

dbowner_password

Username and password of the user who should be the owner of the database.

tablespace;

tablespaceidx

Specifies which tablespaces are to be used.

For some environments (e.g. cloud based environments) the specification of tablespaces is not an option. In these cases an empty string can be provided for both parameters in order to use the default tablespaces.

tablespace=
tablespaceidx=


create_user

True, if a new user should be created. False, if not.

create_db

Specifies whether a new database should be created.

dblocale

Locale, which is used for the database collation. Note, depending on whether the database is installed on Windows or Linux, this setting will require different locale names.

Windows examples:

  • English_United States.1252

  • German_Germany.1252

Linux examples:

  • en_US.utf8

  • de_DE.utf8

create_tablespace

True, if tablespaces are to be created. False, if not.

data_location;

index_location

Specifies the path where the data/index files are located (only required if create_tablespace = true).


New Installation

This section describes how to set up a fresh HAKOM TSM database on an existing PostgreSQL instance.

Pre-deployment Configuration

The scripts to be imported can be found under the following path: Database Scripts\PostgreSQL. 

_manual check scripts and _specific scripts are not required for a new installation of a PostgreSQL database.

Executing the Powershell Scripts

Windows

To set up the database via powershell scripts, ensure that the file "configuration.ini" is properly configured as described in the chapter "Configuration.ini"

  1. Place the installation package in a local folder.

  2. Open a Windows PowerShell

  3. Navigate to Database Scripts\PostgreSQL

  4. Run the file install-latest.ps1
    screenshot postgre script run linux.png

Linux

To set up the database via powershell scripts, ensure that the file "configuration.ini" is properly configured as described in the chapter "Configuration.ini"

  1. Place the installation package in a local folder.

  2. Open a command line interface

  3. Navigate to Database Scripts\PostgreSQL

  4. Run the file install-latest.ps1
    image2021-7-2_12-10-10.png


Update

This section describes how to upgrade an existing database which already has HAKOM components installed to a more recent version.

Preparation

In order to determine the HAKOM database version currently in use check the entries of the table DBVERSION. The interpretation of the entries is explained in the following example:

  • Table DBVERSION:

ID

NAME

DESCRIPTION

CREATIONDATE

REVISION

PATCH

MAJOR

MINOR

1

HAKOM Framework

-

01.07.2021

6

0

3

8

  • Interpretation:

Version HAKOM Framework 3.8.6.0

Manual Check Scripts

Before the update scripts are installed, it is important to check if manual check scripts have to be executed. You can find them under \Manual check scripts before upgrade and if necessary, import them into pgAdmin and follow the instructions as described in the scripts.

Executing the Powershell Scripts

Windows

To update the database via powershell scripts, ensure that the file "configuration.ini" is properly configured as described in the chapter "Configuration.ini"

  1. Place the installation package in a local folder.

  2. Open a Windows PowerShell

  3. Navigate to the path of the next higher version than the current version

  4. Run each of the following scripts if they exist in the given folder:

    1. upgrade.ps1

    2. upgrade-Index.ps1

  5. Repeat steps 3 and 4 up to the desired version.

Linux

To update the database via powershell scripts, ensure that the file "configuration.ini" is properly configured as described in the chapter "Configuration.ini"

  1. Place the installation package in a local folder.

  2. Open a command line interface

  3. Navigate to the path of the next higher version than the current version

  4. Run each of the following scripts if they exist in the given folder:

    1. upgrade.ps1

    2. upgrade-Index.ps1

  5. Repeat steps 3 and 4 up to the desired version.