# dnf list installed | grep postgresql
VRTSnbpostgresqlagent.x86_64 9.1.0.0-1620848511 @System
postgresql.x86_64 10.17-2.module+el8.5.0+11838+8dca950a @rhel8-appstream
postgresql-server.x86_64 10.17-2.module+el8.5.0+11838+8dca950a @rhel8-appstream
postgresql10.x86_64 10.22-1PGDG.rhel8 @rhel8-pgdg10
postgresql10-contrib.x86_64 10.22-1PGDG.rhel8 @rhel8-pgdg10
postgresql10-libs.x86_64 10.22-1PGDG.rhel8 @rhel8-pgdg10
postgresql10-server.x86_64 10.22-1PGDG.rhel8 @rhel8-pgdg10
# dnf list installed | grep postgis
postgis31_10.x86_64 3.1.7-1.rhel8 @rhel8-pgdg10
postgis31_10-client.x86_64 3.1.7-1.rhel8 @rhel8-pgdg10
postgis31_10-devel.x86_64 3.1.7-1.rhel8 @@commandline
postgis31_10-utils.x86_64 3.1.7-1.rhel8 @@commandline(我的同事从.在某个地方)
当我们尝试CREATE EXTENSION postgis;时,我们得到以下错误
ERROR: could not access file "$libdir/postgis-3": No such file or directoryPostgreSQL在/usr/pgsql-10/和/usr/pgsql-10/lib中的安装位置是扩展名的.so文件(例如,postgis-3.so)。/usr/pgsql-10/share/extension内部是包含以下内容的postgis*.control文件:
# postgis extension
comment = 'PostGIS geometry and geography spatial types and functions'
default_version = '3.1.7'
module_pathname = '$libdir/postgis-3'
relocatable = false当我尝试向文件中添加一个libdir=/usr/pgsql-10/lib行时,错误是ERROR: unrecognized parameter "libdir" in file "/usr/share/pgsql/extension/postgis.control",但是当我们将module_pathname中的路径替换为包含/usr/pgsql-10/lib时,我们只得到了与以前的ERROR: could not access file "$libdir/postgis-3": No such file or directory相同的错误。此外,还尝试安装其他非PostGIS扩展,并得到类似的could not access "$libdir/extension"错误。
这台服务器是由我们的IT管理的,他们帮助安装了一些postgis包,所以我不确定这里是否存在包宇宙错配。
在读取这个答案之后,PostgreSQL数据目录由于空间原因(/pgdata)而被挂载到另一个位置,因此可能在配置更改中遗漏了什么?
发布于 2022-11-02 20:52:54
我有一个类似的问题,结果是我同时安装了两个不同版本的postgresql。从您正在展示的内容来看,我认为您应该删除postgresql.x86_64和postgresql-server.x86_64。您可以使用dnf remove删除它们。
请注意,在删除不兼容的包后,可能需要使用dnf reinstall重新安装正确的包。
https://unix.stackexchange.com/questions/721361
复制相似问题