【发布时间】:2022-05-06 02:18:03
【问题描述】:
我需要将一些 postgres 表与 elasticsearch 同步,并得出结论,我的情况的最佳解决方案是 here 所描述的那个。不幸的是,我仍然无法安装所需的 postgres 扩展 amqp。
我使用 docker,所以我从图像 postgres:13-alpine 开始。
这是我的 Dockerfile 到目前为止的样子:
FROM postgres:13-alpine
ENV POSTGRES_DB ''
ENV POSTGRES_USER ''
ENV POSTGRES_PASSWORD ''
RUN apk update \
&& apk add py-pip make gcc \
&& pip install pgxnclient
然后当你进入容器并尝试运行pgxn install pg_amqp你会得到以下错误。
bash-5.1# pgxn install pg_amqp
INFO: best version: pg_amqp 0.3.0
INFO: saving /tmp/tmpgjtefhgh/pg_amqp-0.3.0.zip
INFO: unpacking: /tmp/tmpgjtefhgh/pg_amqp-0.3.0.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/pg_amqp.o src/pg_amqp.c
src/pg_amqp.c:36:10: fatal error: unistd.h: No such file or directory
36 | #include <unistd.h>
| ^~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/pg_amqp.o] Error 1
ERROR: command returned 2: make PG_CONFIG=/usr/local/bin/pg_config all
似乎我不知道该怎么办。有什么帮助吗?
【问题讨论】:
标签: postgresql postgresql-extensions