* PostgreSQL 9.1 インストール [#jcf0fbbc]

** postgresユーザの作成 [#e0862ef9]
 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

** コンパイル・インストール [#hcae09a2]
 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

** 設定 [#hd627024]
*** パーミッション修正 [#g01fe1cf]
 chown postgres /usr/local/pgsql
 chmod 755 /usr/local/pgsql

*** ライブラリパス修正 [#yab51260]
 cat > /etc/ld.so.conf.d/postgresql.conf
 /usr/local/pgsql/lib
 ldcondig
 
 ldconfig

*** 起動スクリプト設置 [#o9e66623]
 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


** データベース初期化・起動 [#k5e0a4f5]
 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