欢迎光临散文网 会员登陆 & 注册

在CentOS7中为PostgreSQL14安装pg_partman

2023-02-12 21:20 作者:冷山之灵  | 我要投稿

关于pg_config 描述: https://www.postgresql.org/docs/current/app-pgconfig.html

1. 将postgres添加到PATH环境变量

/usr/pgsql-14/bin

2. 安装postgresql14-devel

未安装的情况下使用make构建编译环境时会报错 '/usr/pgsql-14/lib/pgxs/src/makefiles/pgxs.mk' 不存在

postgresql-devel Description:

The postgresql-devel package contains the header files and libraries needed to compile C or C++ applications which will directly interact with a PostgreSQL database management server and the ecpg Embedded C Postgres preprocessor. You need to install this package if you want to develop applications which will interact with a PostgreSQL server.

安装时一定要指定版本号, 不能直接 yum install postgresql-devel, 否则安装的版本是9.2.4, 并且会在/usr/bin下面再次生成一个pg_config二进制文件, 由于/usr/bin也在PATH中并且优先级更高, 导致运行pg_config --version时实际执行的是 /usr/bin/pg_config --version, 返回结果是9.2.4, 不满足Makefile的最低版本要求.

首先更新yum源

yum源路径: /etc/yum.repos.d/pgdg-redhat-all.repo

安装postgresql14-devel

3. 编译安装文件 pg_partman, pg_cron

安装时如果出现Requires: llvm5.0-devel >= 5.0 或 Requires: llvm-toolset-7-clang >= 4.0.1错误, 需分别安装对应的package

4. 安装 pg_partman, pg_cron

修改postgresql.conf

/var/lib/pgsql/14/data/postgresql.conf

创建完成

参考资料: 

https://www.postgresql.org/docs/current/app-pgconfig.html

https://yum-info.contradodigital.com/view-package/updates/postgresql-devel/

https://blog.csdn.net/ciqingloveless/article/details/128289892

https://www.postgresql.org/message-id/CANW1aT8C7PY9wP1Spc8YoqYOuPsN5nJEKiiLbkFFwbED_wi3gg%40mail.gmail.com

https://stackoverflow.com/questions/61904796/cloudlinux-7-8-error-installing-postgresql-11-requires-llvm-toolset-7-clang

在CentOS7中为PostgreSQL14安装pg_partman的评论 (共 条)

分享到微博请遵守国家法律