无法在默认的 postgresql 版本中安装 pgaudit

无法在默认的 postgresql 版本中安装 pgaudit

当我尝试安装pgauditDiscourse 默认提供的 postgresql 时,收到如下失败消息:

<Error Messages>
root@07f8d9674261:/pgaudit#  make check USE_PGXS=1
Makefile:16: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk'.  Stop.
root@07f8d9674261:/pgaudit# cd pgaudit/

你知道原因吗?我该如何解决这个问题?

答案1

这是由于没有安装服务器开发包。例如,在 Debian/Ubuntu 上,此处缺少的 Makefile 由postgresql-服务器-dev-11包裹。

以 root 身份运行apt install postgresql-server-dev-11来安装它。

$ dpkg -S pgxs.mk
postgresql-server-dev-11: /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk

$ apt show postgresql-server-dev-11
Package: postgresql-server-dev-11
Version: 11.5-1.pgdg18.04+1
Priority: optional
Section: libdevel
Source: postgresql-11
Maintainer: Debian PostgreSQL Maintainers <[email protected]>
Installed-Size: 5 190 kB
Depends: clang-6.0, libpq-dev (>= 11~~), llvm-6.0-dev, postgresql-common (>= 142~), libc6 (>= 2.14)
Breaks: postgresql-server-dev-all (<< 181~)
Homepage: http://www.postgresql.org/
Download-Size: 933 kB
APT-Manual-Installed: yes
APT-Sources: http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 Packages
Description: development files for PostgreSQL 11 server-side programming
 Header files for compiling SSI code to link into PostgreSQL's backend; for
 example, for C functions to be called from SQL.
 .
 This package also contains the Makefiles necessary for building add-on
 modules of PostgreSQL, which would otherwise have to be built in the
 PostgreSQL source-code tree.
 .
 PostgreSQL is an object-relational SQL database management system.

相关内容