postgresql - Install postgres extension PGXN "fatal error: unistd.h: No such file or directory"
问题描述
I need to sync some postgres tables with elasticsearch and come to conclusion that the best solution for my case is the one described here. Unfortunately I'm still failing to install required postgres extension amqp.
I use docker so I start from image postgres:13-alpine.
Here is how my Dockerfile looks like so far:
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
Then when you enter the container and try to run pgxn install pg_amqp
you will get following error.
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
It seems that I am out of the ideas what to do with that. Any help?
解决方案
推荐阅读
- javascript - 试图注册两个同名的视图 RCTVideo
- jquery - 在 img src 中嵌入 php 代码不允许缩略图
- virtualbox - 无法通过主机获取链接到沙盒 IP 地址的 localhost
- c# - 如何更新或删除一个表中的数据并将该更改反映在另一个表中
- python - 破折号错误地格式化时间序列的 x 轴
- laravel - Composer 找不到 composer.json 文件?
- java - 我是编程新手,一直收到错误消息,不知道如何解决
- html - CSS:调整 div 大小以适应绝对定位的内容
- mysql - DB Design - 按类别显示表格
- assembly - 在 MBR 中指定分区表时,磁盘映像显示为不可引导