目次
# yum install readline-devel
# wget -P /usr/local/src http://ftp.postgresql.org/pub/source/v9.2.2/postgresql-9.2.2.tar.gz
# cd /usr/local/src # tar zxvf postgresql-9.2.2.tar.gz
# groupadd postgres # useradd -g postgres postgres # passwd postgres
# chown -R postgres:postgres /usr/local/src/postgresql-9.2.2
# mkdir /usr/local/postgresql-9.2.2 # chown -R postgres:postgres /usr/local/postgresql-9.2.2
# su - postgres
$ cd /usr/local/src/postgresql-9.2.2 $ ./configure \ > --prefix=/usr/local/postgresql-9.2.2 \ > --enable-nls=ja \ > --with-opensslreadlineが無い場合下記が表示される
(省略) checking for -lreadline... no checking for -ledit... no configure: error: readline library not found If you have readline already installed, see config.log for details on the failure. It is possible the compiler isn't looking in the proper directory. Use --without-readline to disable readline support.
$ make $ make install $ exit
# ln -s /usr/local/postgresql-9.2.2 /usr/local/pgsql # chown -R postgres:postgres /usr/local/pgsql
# su - postgres $ vi ~/.bash_profile PGHOME=/usr/local/pgsql PGDATA=$PGHOME/data PGLIB=$PGHOME/lib PATH=$PATH:$PGHOME/bin export PGHOME PGDATA PGLIB
$ source ~/.bash_profile
$ initdb --encoding=EUC_JP --no-locale --pgdata=/usr/local/pgsql/data
# cp /usr/local/src/postgresql-9.2.2/contrib/start-scripts/linux /etc/rc.d/init.d/pgsql
# vi /etc/rc.d/init.d/pgsql
# chmod 755 /etc/rc.d/init.d/pgsql # chkconfig --add pgsql # chkconfig pgsql on # chkconfig --list pgsql pgsql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# vi /etc/ld.so.conf /usr/local/pgsql/lib ← 追加して保存 # ldconfig ← 変更の適用