1. Configure the YUM Repository
Modify the original yum repository Configuration:
Vim/etc/yum. repos. d/CentOS-Base.repo
Insert a row at the end of the [base] and [updates] sections (sections:
Exclude = postgresql *
Used to cancel the installation and update of PostgresQL from the default repository.
Ii. download and install the pgdg rpm file
Note: In this example, install PostgrSQL 9.1 On CentOS6.3 32-bit.
1. Download
Curl-O
Http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-centos91-9.1-4.noarch.rpm
2. Install the corresponding RPM file
Rpm-ivh pgdg-centos91-9.1-4.noarch.rpm
3. Install PostgreSQL Server
Yum install postgresql91-server
Iv. commands after installation
1. initialize the database(Default data directory path:/var/lib/pgsql/9.1/data)
Service postgresql-9.1 initdb
2. Start postgresql database service
Service psotgresql-9.1 start
References
1. http://wiki.postgresql.org/wiki/YUM_Installation
2. http://www.cnblogs.com/shanyou/archive/2012/08/25/2656783.html