PostgreSQL 9.1 インストール

postgresユーザの作成

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

コンパイル・インストール

 cd /usr/local/src/postgresql
 wget ftp://ftp2.jp.postgresql.org/pub/postgresql/source/v9.1.3/postgresql-9.1.3.tar.gz
 tar zxvf postgresql-9.1.3.tar.gz
 cd postgresql-9.1.3/
 ./configure --prefix=/usr/local/pgsql
 make
 checkinstall --fstrans=no
 rpm -ivh postgresql.rpm

設定

パーミッション修正

 chown postgres /usr/local/pgsql
 chmod 755 /usr/local/pgsql

ライブラリパス修正

 cat > /etc/ld.so.conf.d/postgresql.conf
 /usr/local/pgsql/lib
 
 ldconfig

起動スクリプト設置

 cp /usr/local/src/postgresql/postgresql-9.1.3/contrib/start-scripts/linux  /etc/rc.d/init.d/postgres
 chmod 755 /etc/rc.d/init.d/postgres
 chkconfig postgres on
 chkconfig | grep postgres

データベース初期化・起動

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

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

Last-modified: 2012-04-05 (木) 08:27:27