First, install the associated dependent libraries:
1) GNU make
GNU make is required and the version is greater than or equal to 3.76.1, check the Gmake method:
Gmake--version
installation command:
Yum-y Install make
2) zlib
PostgreSQL uses zlib compression library by default
installation command:
Yum-y Install Zlib-devel
3) GCC
Because the compiler requires a compiler that is compatible with Iso/ansi C, comply with the C89 standard.
installation command:
Yum-y Install GCC
4) GNU Readline
PostgreSQL defaults to using the GNU ReadLine Library to support the use of the cursor key (↑↓) in the Psql command line to turn the history command on.
installation command:
Yum-y Install Readline-devel
The second is the installation process of the database:
1. Installing PostgreSQL
Yum-y Install PostgreSQL
Yum-y Install Postgresql-server
Yum-y Install PYTHON-PSYCOPG2
3. Database initialization
Service PostgreSQL Initdb
4. Database parameter Configuration
In/var/lib/pgsql/data/pg_hba.conf, change the default validation method ident to trust (note: Modify Local/ipv4/ipv6 three items)
5. Start the database
Service PostgreSQL Start
6. Boot from boot
Chkconfig--add PostgreSQL
Finally, it is recommended to implement
Service PostgreSQL Restart
Database PostgreSQL Installation