1. Check if PostgreSQL is installed
Rpm-qa|grep postgres Check if PostgreSQL is installed
If it is already installed, uninstall it using the RPM-E command.
Rpm-e postgresql94-contrib-9.4. 3-1pgdg.rhel6.x86_64 postgresql94-server-9.4. 3-1pgdg.rhel6.x86_64 -e postgresql94-9.4. 3-1pgdg.rhel6.x86_64 postgresql94-libs-9.4. 3-1pgdg.rhel6.x86_64 Uninstall
2. Install the postgresql94 version using the Yum Library settings
Yum Install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm using the Yum Library
3. Installing postgresql94
Yum search PostgreSQL //can also be found first, the server version will have multiple, decided to choose which to install
Yum-y Install Postgresql94-server postgresql94-contrib//Installation postgresql94
Note: If an error occurs, the above installation will be performed once
Installation Successful
4. Initializing the database
Service postgresql-9.4 initdb
If an error is made during startup, for example: Data directory is not empty! [Failed], it is estimated that there is a problem with the installation, I have just started the installation of this problem, uninstall the reinstallation.
5. Set the boot-up PostgreSQL
Chkconfig postgresql-9.4
PostgreSQL installation detailed steps (Linux)