1. PostgreSQL是什么?
PostgreSQL是一个对象关系型数据库管理系统,支持SQL标准查询语言。
- 开源、免费。
- 运行速度快,多进程模型。
- 支持多平台。
- 容易做读写分离、负载均衡和数据水平拆分。
2. 安装和配置
2.1 CentOS7在线安装
主要基于CentOS7安装PostgreSQL11版本。
在线基于yum安装PostgreSQL。
-
安装RPM源
yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
-
安装客户端
yum install postgresql11
-
安装服务端
yum install postgresql11-server
-
初始化并设置自动启动
/usr/pgsql-11/bin/postgresql-11-set