環境:CentOS Linux release 7.4.1708 (Core)
postgresql版本:9.5
官網地址:https://www.postgresql.org/download/linux/redhat/
1.安裝
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql95-server
/usr/pgsql-9.5/bin/postgresql95-setup initdb
systemctl enable postgresql-9.5
systemctl start postgresql-9.5
2.使用
su - postgres
-bash-4.2$ psql
postgres=# select version();
\l
\q
su - postgres
psql -U postgres
alter user postgres with password '123456'