Home > CentOS4でPostgres7系→8系にアップグレード。

CentOS4でPostgres7系→8系にアップグレード。

  • Posted by: モトヲ
  • 2009年3月13日 17:26

ちょっとハマッたのでメモ。

CentOS4でyum install postgresqlだと、標準で7がインストールされるんだけど、今回欲しいのは8.2。普通にupdateかけても8にはならないので、ゴニョゴニョする必要あり。

まずはこちらを参考にして、yumのpostgresql8.2用リポジトリを取得&インストール。

[root@localhost ~]# wget http://yum.pgsqlrpms.org/reporpms/8.2/pgdg-centos-8.2-4.noarch.rpm
[root@localhost ~]# rpm -ivh pgdg-centos-8.2-4.noarch.rpm

で、/etc/yum.repos.d/pgdg-82-centos.repoが追加されたんだけど、ベースのリポジトリとカブるんで、/etc/yum.repos.d/CentOS-Base.repoにpostgresは除外する設定を追加。

[base]
(中略)
exclude=postgresql* ←これ追加

[update]
(中略)
exclude=postgresql* ←これ追加

で、アップデート。

[root@localhost ~]# yum update postgresql postgresql-server
(中略)
Error: Missing Dependency: libpq.so.3 is needed by package php-pgsql
Error: Missing Dependency: libpq.so.3 is needed by package perl-DBD-Pg
Error: Missing Dependency: libpq.so.3 is needed by package postgresql-python

って怒られた。とりあえず上の3つのパッケージを削除してみる。

[root@localhost ~]# yum remove php-pgsql perl-DBD-Pg postgresql-python

で再度アップデート。

[root@localhost ~]# yum update postgresql postgresql-server

いっちょあがり。

のつもりが、DB起動したら、古いDBの形式だって怒られたんで、DBの初期化。
postgresユーザから、

[root@localhost ~]# su - postgres
-bash-3.00$ initdb -D /var/lib/pgsql/data

で、ようやくいっちょあがり。
今回はまっさらの状態からのアップデートだったから良かったけど、運用中だったら作業前にDBダンプして、DB初期化後にリストアの必要ありますねー。



Comments:0

Comment Form

Trackbacks:0

TrackBack URL for this entry
http://blog.motoo.net/mt-tb.cgi/948
Listed below are links to weblogs that reference
CentOS4でPostgres7系→8系にアップグレード。 from motooLogue

Home > CentOS4でPostgres7系→8系にアップグレード。

Search
Advertisement
BlogParts
Feeds
CC Licence

Creative Commons License

このブログはクリエイティブ・コモンズでライセンスされています。

Return to page top