1. go to https://www.postgresql.org/download/linux/redhat/
2. select version to be installed.
3. Install the repository RPM
4. Install the client packages
5. Optionally install the server packages
6. Optionally initialize the database and enable automatic start
7. service postgresql-version initdb (ignore this step for CentOS7)
8.
chkconfig postgresql-version on
9.change password
9.1 su postgres
9.2 psql
9.3 \l (list all databases)
9.4 alter user postgres with password 'postgres' (change password)
9.5 \c postgres (switch to database postgres)
9.6 \d (list all table of current database)
10. configure postgresql
11. open port 5432