【问题标题】:PostgreSQL - HyperLogLog extension not foundPostgreSQL - 找不到 HyperLogLog 扩展
【发布时间】:2022-10-07 17:50:30
【问题描述】:
有人可以以更好的方式解释(好吧,以让傻瓜理解的方式),或者更正确地解释如何安装超级日志hll 分机号PostgreSQL在我的 Mac M1 机器上。
运行时CREATE EXTENSION hll;
我得到:
Query 1 ERROR: ERROR: could not open extension control file \"/opt/homebrew/share/postgresql/extension/hll.control\": No such file or directory
我是新手,所以这个文档https://github.com/citusdata/postgresql-hll 对我没有多大帮助。
我安装了我需要的所有其他扩展,除了这个..
当输入 which postgres 我得到:
/opt/homebrew/bin/postgres
和版本:postgres (PostgreSQL) 14.3
我看到了有关配置PG_CONFIG 的信息,但我不明白我应该在这里做什么?
我会很感激你的帮助,我希望这篇文章能像我一样对其他傻瓜有用。:)
标签:
postgresql
macos
apple-m1
hyperloglog
【解决方案1】:
我为自己编写脚本如何获取最后一个包并安装它。
我通过make 构建它
# check if Makefile installed
make -v
# download latest release
curl -s https://api.github.com/repos/citusdata/postgresql-hll/releases/latest \
| grep '"tarball_url":' \
| sed -E 's/.*"([^"]+)".*/\1/' \
| xargs curl -o package.tar.gz -L
# extract to hll directory
mkdir hll && tar xf package.tar.gz -C hll --strip-components 1
cd hll
# build and instll extension to postgres extensions folder
make
make install
# remove hll directory
cd ../
rm -r ./hll
# connect to PostgreSQL
psql -U postgres
# install extension in your DB
CREATE EXTENSION hll;