问题描述
我尝试在我的Postgresql 12上安装semver。我成功安装了postgis,并使用以下命令安装pg-semver(扩展名):
I try to install semver on my Postgresql 12. I installed postgis successfully and used following command to install pg-semver (semver extension) on my Centos 7 server:
yum install pg-semver
然后我跑了
CREATE EXTENSION semver;
我遇到以下错误:
我将所有文件从 / usr / share / pgsql / extension /复制到 / usr / pgsql-12 / share / extension。现在我得到以下错误:
I copied all files from "/usr/share/pgsql/extension/" to "/usr/pgsql-12/share/extension". Now I'm getting following error:
更新(28.02.2020):
我删除了pg-semver,因为它提供了PSQL 9.2。我现在尝试使用开发人员提供的文档进行构建。
I removed pg-semver because it delivers for PSQL 9.2. I try to now build itself by using the documentation which developer provided.
我从,然后解压缩。之后,我运行以下命令:
I downloaded the semver extension from https://github.com/theory/pg-semver/archive/master.zip and then unzipped. After that I run following command:
make
并获得:
make install
并获得:
然后:
make installcheck
并获得:
导致某些测试失败的错误,可以在
文件中查看 /tmp/ttt/pg-semver-master/regression.diffs 。您在上面看到的测试
摘要的副本保存在文件
/tmp/ttt/pg-semver-master/regression.out中。
The differences that caused some tests to fail can be viewed in the file "/tmp/ttt/pg-semver-master/regression.diffs". A copy of the test summary that you see above is saved in the file "/tmp/ttt/pg-semver-master/regression.out".
make:*** [installcheck]错误1
make: *** [installcheck] Error 1
regression.out的内容:
the content of regression.out:
/ usr / pgsql-12 / lib /中没有semver.so,/ usr / lib64 / pgsql /中有一个semver.so,但它也适用于9.2版?
There is no semver.so in /usr/pgsql-12/lib/, there is a semver.so in /usr/lib64/pgsql/ but it's also for version 9.2 ?
推荐答案
无法安装 semver
的原因有两个:
The reason why you are unable to install semver
is twofold:
您收到错误无法访问文件 semver:没有这样的文件或目录
,因为您没有复制 / usr / lib64 / pgsql /semver.so
到 / usr / pgsql-12 / lib
。但是,由于以下第二个原因,您不能简单地复制该副本:
You are getting the error could not access file "semver": No such file or directory
because you didn't copy /usr/lib64/pgsql/semver.so
to /usr/pgsql-12/lib
. However, you can't simply copy that over because of this following second reason:
yum install pg-semver
将从EPEL库安装 semver
,该库是CentOS 7附带的预包装的PostgreSQL 9.2版。您安装了PostgreSQL 12版(可以自己编译或下载) PGDG存储库并安装 postgresql12
软件包)。 EPEL存储库随附的 semver.so
文件不兼容,因为它是根据PostgreSQL 9.2版而不是版本12编译的。如果尝试加载EPEL semver.so
到您的v.12数据库中,您将看到:
yum install pg-semver
will install semver
from the EPEL library, which is the pre-packaged PostgreSQL version 9.2 that is shipped with CentOS 7. You installed PostgreSQL version 12 (either by compiling it yourself or downloading the PGDG repo and installing the postgresql12
package). The semver.so
file that is shipped with the EPEL repo is not compatible, as it was compiled against PostgreSQL version 9.2, not version 12. If you attempt to load the EPEL semver.so
into your v.12 database, you will see:
postgres=# create extension semver;
ERROR: incompatible library "/usr/pgsql-12/lib/semver.so": version mismatch
DETAIL: Server is version 12, library is version 9.2.
因此,这是安装 semver $ c $的唯一方法c>是按照编译步骤:
Therefore, the only way for you to install semver
is by following the compilation steps detailed in the documentation:
make
make install
make installcheck
psql -c "CREATE EXTENSION semver;"
如果您尚未这样做(并且已通过PGDG RPM安装了postgresql 12),则需要执行以下操作以下载和编译:
If you have not done so already (and you installed postgresql 12 via PGDG RPM), you will need to do the following in order to download and compile:
yum -y install postgresql12-devel
yum -y groupinstall "Development Tools"
您可能还会遇到编译问题,例如: clang:错误:未知参数:'-flto = thin'
,因为PGDG RPM是使用 clang
编译的-您可以通过执行以下操作来绕过它:
You may also run into issues with compilation, like: clang: error: unknown argument: '-flto=thin'
because the PGDG RPM was compiled with clang
-- you can bypass that by doing:
with_llvm=no make -e
with_llvm=no make -e install
with_llvm=no make -e installcheck
psql -c "create extension semver"
披露:我为 EnterpriseDB(EDB)
这篇关于无法在Postgresql上安装扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!