在CentOS7中為PostgreSQL14安裝pg_partman
關(guān)于pg_config 描述:?https://www.postgresql.org/docs/current/app-pgconfig.html
1. 將postgres添加到PATH環(huán)境變量
/usr/pgsql-14/bin
2. 安裝postgresql14-devel
未安裝的情況下使用make構(gòu)建編譯環(huán)境時會報錯 '/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二進(jìn)制文件, 由于/usr/bin也在PATH中并且優(yōu)先級更高, 導(dǎo)致運行pg_config --version時實際執(zhí)行的是 /usr/bin/pg_config --version, 返回結(jié)果是9.2.4, 不滿足Makefile的最低版本要求.
首先更新yum源
yum源路徑: /etc/yum.repos.d/pgdg-redhat-all.repo
安裝postgresql14-devel
3. 編譯安裝文件 pg_partman, pg_cron
安裝時如果出現(xiàn)Requires: llvm5.0-devel >= 5.0 或 Requires: llvm-toolset-7-clang >= 4.0.1錯誤, 需分別安裝對應(yīng)的package
4.?安裝 pg_partman, pg_cron
修改postgresql.conf
/var/lib/pgsql/14/data/postgresql.conf
創(chuàng)建完成

參考資料:?
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