if you want install latest version check official site
# will install postgres9
sudo yum install postgresql-server postgresql-contrib
sudo postgresql-setup initdb
Set listen port to wildcard
# sudo vim /var/lib/pgsql/data/postgresql.conf
listen_addresses = '*'
Change HBA (host-based authentication) configuration
# sudo vim /var/lib/pgsql/data/pg_hba.conf
host all all 0.0.0.0/0 md5
sudo systemctl start postgresql
sudo systemctl enable postgresql
# check listen port
ss -ant | grep 5432
sudo -i -u postgres
# to access PostgreSQL prompt
psql
# for quit PostgreSQL prompt
\q
createuser --interactive
My new role is
rwuser
createdb test1
# access PostgreSQL prompt with new role
sudo su -c "psql -d test1" - rwuser
# type following command in PostgreSQL prompt
\password
# then set your new password
You can use navicat to connect pgsql later.