Find the right version for yourself and download PostgreSQL https://www.postgresql.org/download/
Version number: postgresql-9.5.10.tar.bz2
System: CentOS7 x86_64
Decompression: TAR-JXVF postgresql-9.5.10.tar.bz2
CD postgresql-9.5.10
./configure--prefix=/usr/local/postgres This time there may be a variety of error, should be you are missing the package (that is, yum installation package) or a few parameters (--without-parameter) to resolve
Make install Installation
Make Clean free file space
Useradd-g Postgres Postgres Create this group with the user
Mkdir/opt/postgres
Chown Postgres:postgres/opt/postgres
Vi/etc/profile Add the things below
Path=/usr/local/postgres/bin: $PATH
Manpath=/usr/local/postgres/share/man: $MANPATH
Source/etc/profile Saving files
Su-postgres
initdb-d/opt/postgres/Initialization
or initialize and start pg_ctl-d/opt/postgres/initdb
Psql into the Command window and start doing everything OK
另外可以安装man 跟doc 好像是 make install-man ;make install-doc;安装完成以后就可以 man psql查看帮助。
PostgreSQL Basic Use (i)