やはりPostgreSQLはソースからコンパイルするのが一番です。(←くどい)
CentOS 5.6 + PostgreSQL 8.4のときと手順は全く同じです。
以下rootで作業します。
以下、ユーザpostgresで作業します。
CentOS 5.6 + PostgreSQL 8.4のときと手順は全く同じです。
以下rootで作業します。
yum -y install readline readline-devel # 事前準備
wget ftp://ftp2.jp.postgresql.org/pub/postgresql/source/v9.1.1/postgresql-9.1.1.tar.gz
tar xvfz postgresql-9.1.1.tar.gz
cd postgresql-9.1.1
./configure
make # コンパイル
make install # インストール
echo "PATH=/usr/local/pgsql/bin:\$PATH" >> /etc/profile # PATHを通しておきます。
adduser postgres # 管理ユーザを作成
mkdir /usr/local/pgsql/data # データディレクトリを作成
chown postgres /usr/local/pgsql/data # オーナーを変更
su - postgres
以下、ユーザpostgresで作業します。
initdb -D /usr/local/pgsql/data # データディレクトリを初期化
pg_ctl start -l logfile -D /usr/local/pgsql/data # サーバ起動
createdb sample # データベース作成
psql sample # 接続テスト
下記のようなプロンプトが出ればOKです。
psql (8.4.9)
Type "help" for help.
sample=# select 1 + 1; # SELECT文を発行してみる
?column?
----------
2
(1 row)
Enjoy!
コメントする