![Не удалось установить pgaudit в версии postgresql по умолчанию](https://rvso.com/image/1604290/%D0%9D%D0%B5%20%D1%83%D0%B4%D0%B0%D0%BB%D0%BE%D1%81%D1%8C%20%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%82%D1%8C%20pgaudit%20%D0%B2%20%D0%B2%D0%B5%D1%80%D1%81%D0%B8%D0%B8%20postgresql%20%D0%BF%D0%BE%20%D1%83%D0%BC%D0%BE%D0%BB%D1%87%D0%B0%D0%BD%D0%B8%D1%8E.png)
При попытке установки pgaudit
в PostgreSQL, который Discourse предоставляет по умолчанию, я получаю сообщения об ошибке, подобные приведенным ниже:
<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упаковка.
apt install postgresql-server-dev-11
Для установки запустите его как root.
$ 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.