參考
https://www.postgresql.org/download/linux/redhat/
1.安裝postgresql repo
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2.安裝postgresql
yum install -y postgresql12 postgresql12-server
3.初始化postgresq
/usr/pgsql-12/bin/postgresql-12-setup initdb
4.啟動postgresq
systemctl enable postgresql-12
systemctl start postgresql-12