アンインストール
sudo su -
rpm -qa | grep postgres
postgresql96-server-9.6.17-1PGDG.rhel7.x86_64
postgresql96-9.6.17-1PGDG.rhel7.x86_64
postgresql96-contrib-9.6.17-1PGDG.rhel7.x86_64
postgresql96-libs-9.6.17-1PGDG.rhel7.x86_64
yum remove 上記のバージョンを指定する。
インストール
これでいける。
https://qiita.com/shinsaka/items/cf45cd87c2c75e35ce12
パスを通す
[shogo@ip-10-0-0-193 ~]$ vim ~/.bash_profile
以下のようにパスを通します。
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
PATH=$PATH:/usr/pgsql-9.6/bin/ →数字は9.6で追加
export PATH →追加
export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
[shogo@ip-10-0-0-193 ~]$ exit
S:Portfolio sahota0701nemoto$ ssh Portfolio_key_rsa
[shogo@ip-10-0-0-193 ~]$ psql --version
psql (PostgreSQL) 9.6.17
[shogo@ip-10-0-0-193 ~]$