PostgreSQL 8.2 インストール

必要なツール・ライブラリのインストール (CentOS6.4)

 yum groupinstall "Development tools"
 yum install readline-devel
 yum install zlib-devel

postgresユーザの作成

 su -
 # groupadd postgres
 useradd -g postgres -d /usr/local/pgsql postgres
 cat >> /usr/local/pgsql/.bashrc
 export PATH=/usr/local/pgsql/bin:$PATH

インストール

 ./configure --prefix=/usr/local/pgsql
 make
 make install

ソースコード

http://www.postgresql.org/ftp/source/

設定

 chmod 755 /usr/local/pgsql
 chown postgres /usr/local/pgsql
 mkdir /usr/local/pgsql/data
 chown postgres /usr/local/pgsql/data
 su - postgres
 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -E EUC-JP --no-locale

起動

 su - postgres
 /usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data/

起動スクリプト

 cd /usr/local/src/postgres/postgresql-8.2.x/contrib/start-scripts
 cp linux /etc/rc.d/init.d/postgresql
 chmod 755 /etc/rc.d/init.d/postgresql
 chkconfig --add postgresql

ソースツリーのpostgresql-8.2.x/contrib/start-scriptsディレクトリ以下にあるファイルを使う。pg_ctlを起動に使うのは推奨されないらしい。

参考

http://www.postgresql.jp/


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2013-11-06 (水) 03:31:11