Install postgresql on centos the quick and easy way
First we download and install the yum package:
rpm -ivh http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-6.noarch.rpm
yum -y postgresql-libs \
This will install the libraries server and all oher packages needed.
once yum has completed, we have to initialize the db.
service postgresql initdb
service postgresql start
psql -U postgres < adminpack.sql
The above command, has initialized the database, started the postgres db engine, and install the pgsql adminpack also known as the contrib pack.
Postgres is now installed and ready to use.