add repo details /etc/hosts : 
vi /etc/hosts
10.88.1.53 repo.npci.org.in
 
step 1 : wget postgres tar to /home/npciappuserl2
wget https://jenkins:<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>/repository/raw-binary-artifacts/postgres/12.18/postgresql-12.18.tar.gz
 
 
untar postgresql-12.18.tar.gz ---> 
tar -xvf postgresql-12.18.tar.gz
 
 
./configure --prefix=/usr/lib/postgresql/12  --without-readline
apt install gcc build-essential zlib1g-dev libreadline6-dev libicu-dev pkg-config
 
make
make install
export PATH="/usr/lib/postgresql/12/bin/:$PATH"
source ~/.bashrc
apt install postgresql-client-common
ln -s /postgres/postgres12/12/lib/libpq.so.5 /usr/lib/libpq.so.5
 
which psql
psql --version
 
 
cd /usr/lib/postgresql/12
mkdir -p /postgres/postgres12/12/
cp -r bin/ include/ lib/ share/ /postgres/postgres12/12/
 
creating pg_data mountpoint 
-----------------------------
pvcreate /dev/vdb /dev/vdc
vgcreate vg_data /dev/vdb
lvcreate -l 100%FREE -n lv_data vg_data
mkfs.xfs /dev/vg_data/lv_data
mkdir /pg_data
mount /dev/vg_data/lv_data /pg_data/
echo "/dev/mapper/vg_data-lv_data /pg_data xfs defaults 0 0" >> /etc/fstab
 
creating directories /postgres/postgres12/12/
creating directories  /pg_data/postgres/
cd /pg_data
mkdir postgres
cd postgres
 
mkdir data 8002 8003
 
 
 
creating postgres user
-----------------------
useradd -m postgres 
usermod -aG sudo postgres 
chage -M -1 postgres
cd ../..
chown postgres:postgres postgres/
ownerships
chown -R postgres:postgres /postgres/postgres12/
chown -R postgres:postgres /pg_data/postgres/
 
 
 
 
ownership to postgres user ===> chown postgres:postgres postgres/
 
 
su postgres
bash
exit
cd /pg_data/postgres/data
cd /pg_data/postgres/8002
cd /pg_data/postgres/8003
/postgres/postgres12/12/bin/initdb -D /pg_data/postgres/data/
/postgres/postgres12/12/bin/initdb -D /pg_data/postgres/8002/
/postgres/postgres12/12/bin/initdb -D /pg_data/postgres/8003/
 
 
wget https://jenkins:<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>/repository/raw-binary-artifacts/bhim/services/data_bkpch.sql
wget https://jenkins:<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>/repository/raw-binary-artifacts/bhim/services/8002_bkpch.sql
wget https://jenkins:<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>/repository/raw-binary-artifacts/bhim/services/8003_bkpch.sql
 
 
adding the lines in pg_hba.conf
 
host npcidb1     cloud    127.0.0.1/32      md5
host npcidb_transactions     postgres    127.0.0.1/32      md5
host npcidb_customers        postgres    127.0.0.1/32      md5
 
 
in root user give ownerships again to /pg_data
 
su postgres
 
vi /pg_data/postgres/data/pg_hba.conf
vi /pg_data/postgres/8002/pg_hba.conf
vi /pg_data/postgres/8003/pg_hba.conf
vi /pg_data/postgres/data/postgresql.conf
vi /pg_data/postgres/8002/postgresql.conf
vi /pg_data/postgres/8003/postgresql.conf
 
initialising ports
 
/postgres/postgres12/12/bin/pg_ctl -D /pg_data/postgres/data start
/postgres/postgres12/12/bin/pg_ctl -D /pg_data/postgres/8002 start
/postgres/postgres12/12/bin/pg_ctl -D /pg_data/postgres/8003 start
 
adding dumps
 
/postgres/postgres12/12/bin/psql -p 5432 < /pg_data/postgres/data/data_bkpch.sql
/postgres/postgres12/12/bin/psql -p 8002 < /pg_data/postgres/8002/8002_bkpch.sql
/postgres/postgres12/12/bin/psql -p 8003 < /pg_data/postgres/8003/8003_bkpch.sql
 
 
psql -h localhost -p 5432 -U cloud -d npcidb1
psql -h localhost -p 8002 -U cloud -d npcidb_transactions
psql -h localhost -p 8003 -U cloud -d npcidb_customers
explain what are we doing with these commands and tell me with these commands , will the service up or not?