CentOS7にpostgreSQLをソースからコンパイルでインストール
利用環境
>
VirtualBox 6.0.12 platform packages
CentOS-7-x86_64-DVD-1908.iso
postgresql-11.5.tar.bz2
>
VirtualBoxのインストール~設定
それぞれ以下サイトから入手できます。(2019/09/20時点)
https://www.virtualbox.org/wiki/Downloads
https://www.centos.org/
https://www.postgresql.org/ftp/source/v11.5/

ネットワーク設定はブリッジモードで
CentOS7のインストール
サーバー(GUI利用)を選択
あとは、なりで
postgreSQLのコンパイル
コンパイル用のツール群のインストール
ここからは、TeraTermでSSHログインして行う

readline-develパッケージのインストール
yum -y install readline-devel

zlib-develパッケージのインストール
yum -y install zlib-devel

gccのインストール
yum -y install gcc

postgreSQLのコンパイル
root以外のユーザーへ変更
'''
su - mayser
wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.bz2
tar xf postgresql-11.5.tar.bz2

./configure --prefix=$HOME/pgsql
ここで指定した --prefix=$HOME/pgsql がインストール先になる。
make
make install
マシンの性能によりますが、結構時間がかかります。
以下のメッセージが表示されればコンパイルは完了です。
All of PostgreSQL successfully made. Ready to install.


###起動~接続
export PATH=$HOME/pgsql/bin:$PATH
initdb --encoding=UTF8 -D $HOME/mypgsql

pg_ctl -D $HOME/mypgsql start

psql postgres

停止
pg_ctl -D $HOME/mypgsql stop
```

本記事はここまで
CentOS起動時に自動起動するスクリプトや、ホスト側(Windows10)からの接続許可などは
別記事にします。