SQLの停止
pg_ctl stop
8.4のpgsqlをrename
mv /usr/local/pgsql /usr/local/pgsql_old
version9.0のコンパイル&インストール
$ cd ~/download/postgresql-9.0.1
$ ./configure
$ make
$ sudo make install
pg_upgrade, pg_upgrade_supportのコンパイル&インストール
$ cd ~/download/postgresql-9.0.1/contrib/pg_upgrade
$ make
$ sudo make install
$ cd ~/download/postgresql-9.0.1/contrib/pg_upgrade_support
$ make
$ sudo make install
version9.0 で初期化
$ cd /usr/local/pgsql/bin
$ ./initdb --no-locale --encoding=UTF8 -D ../data
pg_upgradeを実行
パラメータは以下のとおりになる
pg_upgrade
--old-datadir "/usr/lib/postgresql/8.4/data"
--new-datadir "/usr/local/pgsql/data"
--old-bindir "/usr/lib/postgresql/8.4/bin"
--new-bindir "/usr/local/pgsql/bin
pg_upgradeの実行
$ cd /usr/local/pgsql/bin
$ pg_upgrade --old-datadir "/usr/lib/postgresql/8.4/data" --new-datadir "/usr/local/pgsql/data" --old-bindir "/usr/lib/postgresql/8.4/bin" --new-bindir "/usr/local/pgsql/bin"
Performing Consistency Checks
-----------------------------
Checking old data directory (/usr/lib/postgresql/8.4/data) ok
Checking old bin directory (/usr/lib/postgresql/8.4/bin) ok
Checking new data directory (/usr/local/pgsql/data) ok
Checking new bin directory (/usr/local/pgsql/bin) ok
Trying to start old server .................ok
Unable to start old postmaster with the command: "/usr/lib/postgresql/8.4/bin/pg_ctl" -l "/dev/null" -D "/usr/lib/postgresql/8.4/data" -o "-p 5432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000" start >> "/dev/null" 2>&1
Perhaps pg_hba.conf was not set to "trust".
参考資料: