Details
sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install postgresql12
sudo yum install postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl enable postgresql-12
sudo systemctl start postgresql-12
After installation follow below steps to login to PostgreSQL.By default a user with name "postgres" is created after installtation.
sudo su - postgres
psql
CREATE DATABASE test_db;
\c test_db
Category: Linux