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 \
postgresql-devel \
postgresql \
postgresql-server \
postgresql-contrib
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
cd /usr/share/pgsql/contrib
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.