yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

yum -y update
reboot
Confirm the list of enabled repositories.
sudo yum repolist
Check to see if PostgreSQL 14 packages are available on the repository.
yum search postgresql14
Now Install Postgresql-14 on both master/slave servers.
yum -y install postgresql14 postgresql14-server

/usr/pgsql-14/bin/postgresql-14-setup initdb
Start the PostgreSQL database service.
systemctl start postgresql-14
Check the service status to confirm it is running.
systemctl status postgresql-14
Enable the service to start when the system is reboted.
systemctl enable postgresql-14
Update the PostgreSQL admin user password.
su - postgres
psql -c "alter user postgres with password 'StrongDBPassword'"
