Professional Documents
Culture Documents
I n s t all
R22
TAFJ-Po s t g r e S QL I n s t all
Amendment History:
Revisio
Date Amended Name Description
n
Page 2
TAFJ-Po s t g r e S QL I n s t all
Copyri g h t
Copyright © Temenos Headquarters SA 2009-2022
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland
Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com
Page 3
TAFJ-Po s t g r e S QL I n s t all
Table of Contents
Copyright................................................................................................................................................ 3
Errata and Comments............................................................................................................................ 3
Introduction............................................................................................................................................. 5
Download PostgreSQL........................................................................................................................... 5
Install PostgreSQL.................................................................................................................................. 5
Connect to the database...................................................................................................................... 16
Set and add PG_HOME variable.......................................................................................................... 18
Install necessary T24-Transact related settings into PostgreSQL DB..................................................18
Create the T24 database and user....................................................................................................... 18
Login with new t24 user:....................................................................................................................... 19
Install PostgreSQL with Docker............................................................................................................ 24
Install PostgreSQL for Ubuntu.............................................................................................................. 26
Supported File Types........................................................................................................................... 27
JSON File Type.................................................................................................................................... 27
Switch between JSON Implementations............................................................................28
CREATE-FILE Syntax.......................................................................................................28
DBImport........................................................................................................................... 29
Index On JSONB Values...................................................................................................29
Page 4
TAFJ-Po s t g r e S QL I n s t all
Intro d u c t i o n
This document will show all steps to configure a database, ready to be used by T24 with
TAFJ.
This procedure is for Windows® platform. For all other OS please refer to the official product
documentation.
Dow n l o a d Pos t g r e S Q L
From the following link: https://www.enterprisedb.com/downloads/postgres-postgresql-
downloads
Inst a l l Pos t g r e S Q L
Execute the downloaded file postgresql-13.1-1-windows-x64.exe.
Press Next…
Page 5
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Next…
Page 6
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Page 7
TAFJ-Po s t g r e S QL I n s t all
Set a Password. This is NOT (!) the password you will set in the properties file...
Press Next…
Page 8
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Next…
Page 9
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Next…
Page 10
TAFJ-Po s t g r e S QL I n s t all
Press Finish…
Press Next…
Select pgJDBC
Press Next…
Page 11
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Page 12
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Finish…
Page 13
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Next…
Page 14
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Finish…
Execute %PG_HOME%\pgAdmin4\bin\pgAdmin4.exe
Page 15
TAFJ-Po s t g r e S QL I n s t all
Page 16
TAFJ-Po s t g r e S QL I n s t all
You are connected to the database : PosgreSQL with the user postgres
Page 17
TAFJ-Po s t g r e S QL I n s t all
@SET PG_HOME="E:\3rdParty\Db\PostgreSQL\13"
@SET PGDATA=E:\3rdParty\Db\PostgreSQL\13\data
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5432
@SET PGLOCALEDIR=E:\3rdParty\Db\PostgreSQL\13\share\locale
@SET PATH="%PG_HOME%\bin";%PATH%
Change the following parameter with higher number and uncomment it to avoid error
shared memory : max_locks_per_transaction
#--------------------------------------------------------------------------------
--------------------------
max_locks_per_transaction = 10000 (instead of 64 by default)
Post this step; restart the PostgreSQL services to take effect of environment variable
change.
psql.exe
Page 18
TAFJ-Po s t g r e S QL I n s t all
Password:
CREATE TABLESPACE t24data OWNER postgres LOCATION
‘C:\PostgreSQL\postgressData\t24’;
Page 19
TAFJ-Po s t g r e S QL I n s t all
Load the necessary PL/SQL functions into the database using the script under
Server [localhost]:
Database [postgres]: T24
Port [5433]:
Username [postgres]: t24
Password for user t24:
psql (13.1)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
T24=# \i
'C:/Temenos/Development/TAFJ_SOURCES/TAFJ_DEV/TAFJHome/dbscripts/postg
resql/plsqlfunctions_postgresql.sql';
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
Page 20
TAFJ-Po s t g r e S QL I n s t all
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
Page 21
TAFJ-Po s t g r e S QL I n s t all
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
Page 22
TAFJ-Po s t g r e S QL I n s t all
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
T24=#
The line above creates an implicit cast from varchar to numeric. Without it, queries
such as :
The \df command should be executed to verify the functions have been loaded inside DB.
Page 23
TAFJ-Po s t g r e S QL I n s t all
Page 24
TAFJ-Po s t g r e S QL I n s t all
Once done, we are ready for the DB Import process to populate necessary tables and data
for T24 on this newly created database in PostgreSQL.
Page 25
TAFJ-Po s t g r e S QL I n s t all
RUN cd /usr/share/postgresql/ \
&& cd pljava \
With the above image built, one can then run the below docker script to install
TAFJFunctions.jar
FROM ${POSTGRES_IMAGE_BUILT_ABOVE}
Page 26
TAFJ-Po s t g r e S QL I n s t all
RUN chmod 755 /u01/app/start-postgresql.sh && chmod 755 /u01/app && chmod 755
/u01/app/data
USER postgres
ENTRYPOINT /u01/app/start-postgresql.sh
#!/bin/bash
# Debian
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PG_HOME=/usr/local/share/postgresql/
export POSTGRES_DB=$DB_NAME
export POSTGRES_USER=$DB_USER
export POSTGRES_PASSWORD=$DB_PASSWORD
cd /u01/app/sql
# Debian
/usr/lib/postgresql/13/bin/initdb
# Debian
Page 27
TAFJ-Po s t g r e S QL I n s t all
\x
EOF
#Debian
echo "pljava.classpath='/usr/share/postgresql/13/pljava/pljava-1.6.0-
SNAPSHOT.jar:/u01/app/TAFJFunctions.jar'" >> /var/lib/postgresql/data/postgresql.conf
echo "pljava.libjvm_location='/usr/lib/jvm/java-8-openjdk-
amd64/jre/lib/amd64/server/libjvm.so'" >> /var/lib/postgresql/data/postgresql.conf
# Debian
echo
echo
Page 28
TAFJ-Po s t g r e S QL I n s t all
\x
EOF
\x
eosql
# Stored functions
# Wait
Following a similar procedure, it should work for Ubuntu (install of PostgreSQL on Ubuntu not
shown).
As a root os user:
apt-get update -y
Page 29
TAFJ-Po s t g r e S QL I n s t all
As a postgres os user:
cd /usr/share/postgresql/
To get pljava:
cd pljava
cd /usr/share/postgresql/pljava/pljava-packaging/target
SHOW pljava.classpath;
--------------------------------------------------------------------------------------------------------------------------
Page 30
TAFJ-Po s t g r e S QL I n s t all
/usr/share/postgresql/13/pljava/pljava/target/pljava-1.6.0-
SNAPSHOT.jar;/u01/Temenos/TAFJ/dbscripts/h2/TAFJFunctions.jar
SHOW pljava.libjvm_location;
----------------------------------------------------------------------
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
TEXT (DEPRECATED)
JSON (DEFAULT)
XML type is not supported in Postgresql. While creating a file from Transact, widely
“TYPE=XML” is used, by default it will create a JSONB type table in Postgresql. We can
switch this behaviour using the below property. If it is set to VARCHAR, the table is created
with datatype VARCHAR and the data is stored in TEXT format
temn.tafj.jdbc.default.table.type=VARCHAR
Similarly we can define the table datype of dict file using the below property. By default dict
table is of type JSON. If set to VARCHAR, it is created with datatype VARCHAR and the dict
is stored in TEXT format.
temn.tafj.jdbc.default.dict.type=VARCHAR
If the property is set to false, the record is created with index-data JSON layout as below,
Page 31
TAFJ-Po s t g r e S QL I n s t all
"3": "50123"
If the property is set to true, the record is created with field-data JSON layout as below
"Descript": [
"descript": [
],
Page 32
TAFJ-Po s t g r e S QL I n s t all
RECID VARCHAR(255)
XMLRECORD JSONB
DBI m p o r t
Select JSON Layout during DBImport
If a PostgreSQL database was created with earlier versions of TAFJ, then we need to
DBImport the database to make it compatible with latest TAFJ. Set the below property to 1 or
2 in tafj.properties, based upon the requirement.
temn.tafj.db.postgresql.covert.json.model.from.old.to.new.format
Set 2, to convert database from Temenos Implementation of JSON record to org.json library
created JSON record.
Single-value Field:
Multi-Value Field:
Index support for JSONPath is very limited at this point. JSONPath support for indexes will
be improved in subsequent PostgreSQL releases.
Reference: https://scalegrid.io/blog/using-jsonb-in-postgresql-how-to-effectively-store-index-
json-data-in-postgresql/
Page 33