无法在 Postgresql 上安装扩展
Can't install extension on Postgresql
我尝试在我的 Postgresql 12 上安装 semver。我成功安装了 postgis 并使用以下命令在我的 Centos 7 服务器上安装 pg-semver(semver 扩展):
yum install pg-semver
那我运行
CREATE EXTENSION semver;
我收到以下错误:
couldn't open extension control file
/usr/pgsql-12/share/extension/semver.control : No such file or
directory
我将所有文件从“/usr/share/pgsql/extension/”复制到“/usr/pgsql-12/share/extension”。现在我收到以下错误:
ERROR: ERROR: could not access file "semver": No such file or
directory
更新(2020 年 2 月 28 日):
我删除了 pg-semver,因为它为 PSQL 9.2 提供。我现在尝试使用开发人员提供的文档来构建自己。
我从 https://github.com/theory/pg-semver/archive/master.zip 下载了 semver 扩展,然后解压。之后我 运行 以下命令:
make
并得到:
make: There is nothing to do for the "all" target.
then:
make install
并得到:
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c
-m 644 ./semver.control '/usr/share/pgsql/extension/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644
./sql/semver--0.20.0.sql ./sql/semver--unpackaged--0.2.1.sql
./sql/semver--0.20.0--0.21.0.sql ./sql/semver--0.12.0--0.13.0.sql
./sql/semver--0.3.0--0.4.0.sql ./sql/semver--0.16.0--0.17.0.sql
./sql/semver--0.13.0--0.15.0.sql ./sql/semver--0.11.0--0.12.0.sql
./sql/semver--0.2.4--0.3.0.sql ./sql/semver--0.2.1--0.2.4.sql
./sql/semver--0.5.0--0.10.0.sql ./sql/semver--0.10.0--0.11.0.sql
./sql/semver.sql ./sql/semver--0.17.0--0.20.0.sql
./sql/semver--0.15.0--0.16.0.sql '/usr/share/pgsql/extension/'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c
-m 755 src/semver.so '/usr/lib64/pgsql/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644
./doc/semver.mmd '/usr/share/doc/pgsql/extension/'
然后:
make installcheck
并得到:
============== dropping database "contrib_regression" ============== DROP DATABASE
============== creating database "contrib_regression" ============== CREATE DATABASE ALTER DATABASE
============== installing plpgsql ============== CREATE LANGUAGE
============== running regression test queries ============== test base ... FAILED (test process exited with
exit code 3)
--------------- 1 of 1 tests failed.
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] Error 1
regression.out的内容:
...... ! ok 278 - minor version check ! ok 279 - Function
get_semver_patch() should exist ! ok 280 - semver ! ok 281 - Function
get_semver_patch() should return integer ! ok 282 - patch version
check ! ok 283 - Function get_semver_prerelease() should exist ! ok
284 - semver ! ok 285 - Function get_semver_prerelease() should return
text ! ok 286 - prerelease label check ! ok 287 - 1.0.0 should be in
range [1.0.0, 2.0.0] ! ok 288 - 1.0.0 should not be in range [1.0.1,
2.0.0] ! ok 289 - 2.0.0 should not be in range [1.0.1, 2.0.0) ! ok 290 - 1.9999.9999 should be in range [1.0.1, 2.0.0) ! ok 291 - 1000.0.0 should be in range [1.0.0,) ! ok 292 - Should be able to work with
arrays of semverranges
--- 1,2 ---- \set ECHO none ! psql:sql/semver.sql:30: ERROR: could not access file "semver": No such file or directory
/usr/pgsql-12/lib/里没有semver.so,/usr/lib64/pgsql/里有semver.so,但也是9.2版的?
按照本指南安装 semver:
无法安装semver
的原因有两个:
您收到错误 could not access file "semver": No such file or directory
,因为您没有将 /usr/lib64/pgsql/semver.so
复制到 /usr/pgsql-12/lib
。但是,由于以下第二个原因,您不能简单地复制它:
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 数据库中,你会看到:
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
的唯一方法是按照编译步骤detailed in the documentation:
make
make install
make installcheck
psql -c "CREATE EXTENSION semver;"
如果您还没有这样做(并且您通过 PGDG RPM 安装了 postgresql 12),则需要执行以下操作才能下载和编译:
yum -y install postgresql12-devel
yum -y groupinstall "Development Tools"
您也可能 运行 遇到编译问题,例如:clang: error: unknown argument: '-flto=thin'
因为 PGDG RPM 是使用 clang
编译的——您可以通过以下方式绕过它:
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 12 上安装 semver。我成功安装了 postgis 并使用以下命令在我的 Centos 7 服务器上安装 pg-semver(semver 扩展):
yum install pg-semver
那我运行
CREATE EXTENSION semver;
我收到以下错误:
couldn't open extension control file /usr/pgsql-12/share/extension/semver.control : No such file or directory
我将所有文件从“/usr/share/pgsql/extension/”复制到“/usr/pgsql-12/share/extension”。现在我收到以下错误:
ERROR: ERROR: could not access file "semver": No such file or directory
更新(2020 年 2 月 28 日):
我删除了 pg-semver,因为它为 PSQL 9.2 提供。我现在尝试使用开发人员提供的文档来构建自己。
我从 https://github.com/theory/pg-semver/archive/master.zip 下载了 semver 扩展,然后解压。之后我 运行 以下命令:
make
并得到:
make: There is nothing to do for the "all" target. then:
make install
并得到:
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./semver.control '/usr/share/pgsql/extension/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./sql/semver--0.20.0.sql ./sql/semver--unpackaged--0.2.1.sql ./sql/semver--0.20.0--0.21.0.sql ./sql/semver--0.12.0--0.13.0.sql ./sql/semver--0.3.0--0.4.0.sql ./sql/semver--0.16.0--0.17.0.sql ./sql/semver--0.13.0--0.15.0.sql ./sql/semver--0.11.0--0.12.0.sql ./sql/semver--0.2.4--0.3.0.sql ./sql/semver--0.2.1--0.2.4.sql ./sql/semver--0.5.0--0.10.0.sql ./sql/semver--0.10.0--0.11.0.sql ./sql/semver.sql ./sql/semver--0.17.0--0.20.0.sql ./sql/semver--0.15.0--0.16.0.sql '/usr/share/pgsql/extension/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 755 src/semver.so '/usr/lib64/pgsql/' /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./doc/semver.mmd '/usr/share/doc/pgsql/extension/'
然后:
make installcheck
并得到:
============== dropping database "contrib_regression" ============== DROP DATABASE ============== creating database "contrib_regression" ============== CREATE DATABASE ALTER DATABASE ============== installing plpgsql ============== CREATE LANGUAGE ============== running regression test queries ============== test base ... FAILED (test process exited with exit code 3)
--------------- 1 of 1 tests failed.
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] Error 1
regression.out的内容:
...... ! ok 278 - minor version check ! ok 279 - Function get_semver_patch() should exist ! ok 280 - semver ! ok 281 - Function get_semver_patch() should return integer ! ok 282 - patch version check ! ok 283 - Function get_semver_prerelease() should exist ! ok 284 - semver ! ok 285 - Function get_semver_prerelease() should return text ! ok 286 - prerelease label check ! ok 287 - 1.0.0 should be in range [1.0.0, 2.0.0] ! ok 288 - 1.0.0 should not be in range [1.0.1, 2.0.0] ! ok 289 - 2.0.0 should not be in range [1.0.1, 2.0.0) ! ok 290 - 1.9999.9999 should be in range [1.0.1, 2.0.0) ! ok 291 - 1000.0.0 should be in range [1.0.0,) ! ok 292 - Should be able to work with arrays of semverranges --- 1,2 ---- \set ECHO none ! psql:sql/semver.sql:30: ERROR: could not access file "semver": No such file or directory
/usr/pgsql-12/lib/里没有semver.so,/usr/lib64/pgsql/里有semver.so,但也是9.2版的?
按照本指南安装 semver:
无法安装semver
的原因有两个:
您收到错误 could not access file "semver": No such file or directory
,因为您没有将 /usr/lib64/pgsql/semver.so
复制到 /usr/pgsql-12/lib
。但是,由于以下第二个原因,您不能简单地复制它:
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 数据库中,你会看到:
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
的唯一方法是按照编译步骤detailed in the documentation:
make
make install
make installcheck
psql -c "CREATE EXTENSION semver;"
如果您还没有这样做(并且您通过 PGDG RPM 安装了 postgresql 12),则需要执行以下操作才能下载和编译:
yum -y install postgresql12-devel
yum -y groupinstall "Development Tools"
您也可能 运行 遇到编译问题,例如:clang: error: unknown argument: '-flto=thin'
因为 PGDG RPM 是使用 clang
编译的——您可以通过以下方式绕过它:
with_llvm=no make -e
with_llvm=no make -e install
with_llvm=no make -e installcheck
psql -c "create extension semver"
披露:我为 EnterpriseDB (EDB)
工作