CentOS 5.6 に PostgreSQL 9.0 をインストールする。

普通に yum でインストールすると 8.4 系がインストールされるので以下の手順で。

「PostgreSQL RPM Building Project - Yum Repository」 からリポジトリをインストールするパッケージを取得。

以下から対象のパッケージを取得
http://yum.pgrpms.org/reporpms/repoview/pgdg-centos.html

RPM をインストール

$ wget http://yum.pgrpms.org/reporpms/9.0/pgdg-centos-9.0-2.noarch.rpm
$ rpm -ivh pgdg-centos-9.0-2.noarch.rpm

Yum Howto に記載されているようにちょっと設定ファイルを変更。

Important note:

In order to use PGDG repository properly, you may need to exclude postgresql packages from the repository of the distro. Here are the steps:

As root, cd /etc/yum.repos.d
Edit distro's .repo file:
On Fedora, edit fedora.repo and fedora-updates.repo, [fedora] sections
On CentOS, edit CentOS-Base.repo, [base] and [updates] sections.
On Red Hat, edit edit /etc/yum/pluginconf.d/rhnplugin.conf [main] section.
Add
exclude=postgresql*
to the bottom of the section.

あとは普通に yum のコマンドでインストール

$ yum install postgresql-server postgresql-libs postgresql
$ /etc/init.d/postgresql-9.0 initdb
$ /etc/init.d/postgresql-9.0 start