vmw02機更新(PostgreSQL8.3、続き)

その前に aptitudeアップグレードあったのでちょっと。

既存の 8.1 を停止、8.3の設定ファイルを調整(ポート5432)

  1. 8.1を停止
    1. sudo /etc/init.d/postgresql-8.1 stop
  2. rcrunlevel.d からの削除
 sudo update-rc.d postgresql-8.1 remove
update-rc.d: /etc/init.d/postgresql-8.1 exists during rc.d purge (use -f to force)
 sudo update-rc.d -f postgresql-8.1 remove
 Removing any system startup links for /etc/init.d/postgresql-8.1 ...
   /etc/rc0.d/K19postgresql-8.1
   /etc/rc1.d/K19postgresql-8.1
   /etc/rc2.d/S19postgresql-8.1
   /etc/rc3.d/S19postgresql-8.1
   /etc/rc4.d/S19postgresql-8.1
   /etc/rc5.d/S19postgresql-8.1
   /etc/rc6.d/K19postgresql-8.1

8.3の方の設定ファイル調整
/etc/postgresql/8.3/main/postgresql.conf

listen_addresses = 'localhost,192.168.<IPアドレス>'
port = 5432

パッケージインストールでは既存の 8.1 をみて 5433 にしてたのを 5432 に戻す。8.1の方の設定ファイルは変えてないので、何かで両方動かそうとなると競合するので注意必要

/etc/postgresql/8.3/main/pg_hba.conf に追記

host    all         all         192.168.<IPアドレス>/24          md5

そして再起動。

  1. sudo /etc/init.d/postgresql-8.3 stop
  2. sudo /etc/init.d/postgresql-8.3 start

DBデータは Railsマイグレーションで作ったものばかりなので特に移したりしない。またマイグレーションすればいいや。

ついでなんでさらにシステムごと再起動、ハードディスクのチェックが走って起動にちょっと時間掛かった。で、クライアント(psql)のバージョンも上がっていた。
あと、Railsユーザの用のDBユーザ作っておく。