- 进入pg源码文件夹下
cd /opt/module/postgresql-12.2/contrib/
一定要在这装!!! - 下载hypopg
git clone git://github.com/HypoPG/hypopg
如果没有git要先执行执行命令:
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum install -y git
- 安装拓展包
yum install postgresql-devel
!!!
否则make报错:make: pg_config: Command not found make: *** No targets. Stop.
- 修改Makefile文件
cd /opt/module/postgresql-12.2/
vi Makefile
将PG_CONFIG=/opt/pgsql/bin/pg_config
(具体路径根据不同环境自己设置) - 进行编译
cd /opt/module/postgresql-12.2/contrib/hypopg
make&&make install
- 建立插件
使用psql登录数据库后执行CREATE EXTENSION hypopg;
搭建完毕