Professional Documents
Culture Documents
TAFJ-PostgresSQLInstall
TAFJ-PostgresSQLInstall
I n s t all
R20
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-2020
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...................................................................................................................... 18
Set and add PG_HOME variable.......................................................................................................... 19
BUILD PLJava...................................................................................................................................... 19
Open CMD and build PL\Java as administrator....................................................................................21
Install PL_Java and necessary stored functions into PostgreSQL DB..................................................23
Create the T24 database and user....................................................................................................... 24
Login with new t24 user:....................................................................................................................... 25
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-11.6-3-windows-x64.exe.
Press Next…
Page 5
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Page 6
TAFJ-Po s t g r e S QL I n s t all
Press Next…
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...
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…
Page 10
TAFJ-Po s t g r e S QL I n s t all
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 Finish…
Page 13
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Select pgJDBC
Page 14
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Page 15
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Page 16
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Page 17
TAFJ-Po s t g r e S QL I n s t all
Press Finish…
Press Next…
Page 18
TAFJ-Po s t g r e S QL I n s t all
Press Next…
Press Next…
Page 19
TAFJ-Po s t g r e S QL I n s t all
Press Finish…
Execute %PG_HOME%\pgAdmin4\bin\pgAdmin4.exe
Page 20
TAFJ-Po s t g r e S QL I n s t all
Page 21
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 22
TAFJ-Po s t g r e S QL I n s t all
@SET PG_HOME="E:\3rdParty\Db\PostgreSQL\10"
@SET PGDATA=E:\3rdParty\Db\PostgreSQL\10\data
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5432
@SET PGLOCALEDIR=E:\3rdParty\Db\PostgreSQL\10\share\locale
@SET PATH="%PG_HOME%\bin";%PATH%
Page 23
TAFJ-Po s t g r e S QL I n s t all
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
Password:
CREATE TABLESPACE t24data OWNER postgres LOCATION
‘C:\PostgreSQL\postgressData\t24’;
Page 24
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
Page 25
TAFJ-Po s t g r e S QL I n s t all
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
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 26
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 27
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
T24=#
Page 28
TAFJ-Po s t g r e S QL I n s t all
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 29
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 30
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 31
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/10/bin/initdb
# Debian
Page 32
TAFJ-Po s t g r e S QL I n s t all
\x
EOF
#Debian
echo "pljava.classpath='/usr/share/postgresql/10/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 33
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 34
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 35
TAFJ-Po s t g r e S QL I n s t all
/usr/share/postgresql/10/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
Page 36