/dev/null

(◞‸◟)

CentOS 6.4にpostgreSQL9.2.4をソースからインストール

今日からちょっとDBのインストールをしようかなと。

出来たらMaster/Slave構成までやれたらいいね。鯖は1個だけど。

とりあえずpostgreSQLです。

MySQLとの違いとかについてはキチンと調べてまとめたいなぁ。

安定のソース取得

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

ここから

wget http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz

解凍

tar zvxf postgresql-9.2.4.tar.gz

configure

cd postgresql-9.2.4


[~/postgresql-9.2.4]$ ./configure     


.....


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.

readlineがないらしい。

sudo yum -y install readline-devel

ちなみに環境によってはzlibがないエラーが出るかもね

sudo yum -y install zlib-devel

出来たらconfigure

からのmake

make

からのmake install

sudo make install

フィニッシュ。

何もせずconfigureすると/usr/local/pgsql/にインストールされる。

~/.bashrcとか~/.zshrcに

export PATH=$PATH:/usr/local/pgsql/bin

とか書いておけばよろし。

起動は思ったより面倒だったので明日まとめます。