To install postgresql on Ubuntu, use apt install, as shown in the following code snippet:
$sudo apt install postgresql postgresql-contrib
For CentOS or Red Hat Enterprise Linux (RHEL), use the following commands:
$sudo yum install postgresql-server postgresql-contrib
$sudo postgresql-setup initdb
$sudo systemctl start postgresql
Let's create the databases and relations for Bank A and Bank B.