The following are related records for installing PostgreSQL9.1 on CentOS5.5:
The following are related records of installing PostgreSQL 5.5 On CentOS 9.1.
The following are related records of installing PostgreSQL 5.5 On CentOS 9.1.
(1) download the postgresql9. 1 RPM installation package
[Root @ server1 ~] # Wget
(2) install pgdg-centos91-9.1-4.noarch.rpm
[Root @ server1 ~] # Rpm-I pgdg-centos91-9.1-4.noarch.rpm
(3) Change CentOS-Base.repo
To facilitate the installation of related software for postgresql9.1 via yum, you need to change the CentOS-Base.repo so that yum list postgresql * can find related software packages for postgresql9.1
You only need to add 'exclude = postgresql * 'in the [base] and [updates] of the CentOS-Base.repo.
The procedure is as follows:
[Root @ server1 ~] # Cd/etc/yum. repos. d
[Root @ server1 yum. repos. d] # vi CentOS-Base.repo
[Base]
Name = CentOS-$ releasever-Base
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
# Baseurl = http://ftp.sjtu.edu.cn/centos/?releasever/ OS /?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Exclude = postgresql *
# Released updates
[Updates]
Name = CentOS-$ releasever-Updates
Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
# Baseurl = http://ftp.sjtu.edu.cn/centos/?releasever/updates/?basearch/
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Exclude = postgfesql *
# Packages used/produced in the build but not released
(4) use yum list ipvs * to detect related installation packages
[Root @ server1 yum. repos. d] # yum list postgres *
Available Packages
Postgresql91.x86 _ 64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-contrib.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-debuginfo.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-devel.i686 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-devel.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-docs.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-jdbc.x86_64 9.1.901-1PGDG. rhel6 pgdg91
Postgresql91-jdbc-debuginfo.x86_64 9.1.901-1PGDG. rhel6 pgdg91
Postgresql91-libs.i686 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-libs.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-odbc.x86_64 09.000000200-1PGDG. rhel6 pgdg91
Postgresql91-odbc-debuginfo.x86_64 09.000000200-1PGDG. rhel6 pgdg91
Postgresql91-plperl.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-plpython.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-pltcl.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-python.x86_64 4.0-2PGDG. rhel6 pgdg91
Postgresql91-python-debuginfo.x86_64 4.0-2PGDG. rhel6 pgdg91
Postgresql91-server.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql91-tcl.x86_64 1.9.0-1. rhel6 pgdg91
Postgresql91-tcl-debuginfo.x86_64 1.9.0-1. rhel6 pgdg91
Postgresql91-test.x86_64 9.1.1-1PGDG. rhel6 pgdg91
Postgresql_autodoc.noarch 1.40-1. rhel6 pgdg91
[Root @ server1 yum. repos. d] #
(6) Use yum to install postgresql9.1 and related software packages
[Root @ server1 yum. repos. d] # yum install postgresql91 postgresql91-devel postgresql91-server postgresql91-libs postgresql91-contrib
(7) initialize and start postgresql
[Root @ server1 yum. repos. d] # service postgresql-9.1 (initdb)
Initializing database: [OK]
[Root @ server1 yum. repos. d] #
[Root @ server1 yum. repos. d] # service postgresql-9.1 (initdb)
Initializing database: [OK]
[Root @ server1 yum. repos. d] #
Notes for installing postgresql:
(1) If initdb fails, it is likely that the system's default character encoding is inconsistent with what postgresql recognizes, in this case, you can use/var/lib/pgsql/9.1/pgstartup. log error information to confirm
If it is determined that the encoding problem causes initdb to fail, you can solve the problem by specifying -- no-locale at initdb. The specific method is as follows:
1.1 [root @ GJZ bin] # su-postgres
1.2-bash-3.2 $/usr/local/pgsql/bin/initdb -- no-locale
The files belonging to this database system will be owned by user "stored s ".
This user must also own the server process.
The database cluster will be initialized with locale C.
The default database encoding has accordingly been set to SQL _ASCII.
The default text search configuration will be set to "english ".
Fixing permissions on existing directory/var/lib/pgsql/9.1/data... OK
(2) modify the postgresql. conf and pg_assist.conf files in/var/lib/pgsql/9.1/data and configure the relevant access policies as needed.