Postgresql:无法访问文件« $libdir/postgis-2.1 »没有这样的文件或目录 [英] Postgresql: Can't access to file « $libdir/postgis-2.1 » no such file or directory

查看:53
本文介绍了Postgresql:无法访问文件« $libdir/postgis-2.1 »没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我猜这是一个已知问题,但由于我使用了删除我的 postgresql-9.4-postgis-2.1 的脚本,我现在无法在 Debian 下摆脱这个 SQL 错误.

I guess this is a known issue but since I have used a script that removed my postgresql-9.4-postgis-2.1, I'm now unable to get rid of this SQL error under Debian.

无法访问文件 « $libdir/postgis-2.1 » no such file or directory

Can't access to file « $libdir/postgis-2.1 » no such file or directory

我做了以下事情:

- Remove new unwanted postgresql-9.5-postgis-2.2 package installed
- Reinstalling postgresql-9.4-postgis-2.1, postgresql-9.4-postgis-scripts and postgis
- Using SQL: ALTER EXTENSION postgis UPDATE TO '2.1.4' --under postgres user
- Using SQL: ALTER EXTENSION postgis_topology UPDATE TO '2.1.4' --under postgres user

SELECT * FROM pg_available_extensions; 返回

[...]
postgis 2.1.4   2.1.4   PostGIS geometry, geography, and raster spatial types and functions.

但在访问对象(如使用几何类型的表)时仍然会出现此消息.

But still this message when accessing object like tables that uses geometry type.

有什么想法吗?

推荐答案

最终解决"从源代码 postgis 2.2.2(也需要gdal、proj4和geos)编译然后发布的问题

Finally "solve" the issue compiling from source postgis 2.2.2 (that also requires gdal, proj4 and geos) and then issuing

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;

因为 DROP EXTENSION postgis; 告诉我 postgis 不存在了.

since DROP EXTENSION postgis; tells me postgis wasn't present anymore.

最后:

ALTER EXTENSION postgis UPDATE TO '2.2.2';
ALTER EXTENSION postgis_topology UPDATE TO '2.2.2';

从 PostgreSQL 9.4 再次访问我的 geom 数据和函数.似乎从源代码编译正确更新了 postgresql 的变量路径并安装了/usr/lib/postgresql/9.4/lib/postgis-2.2.so 不再存在(对于 postgis-2.1.so 也是如此),即使使用(重新)从 apt-get 安装.

Got access again to my geom data and functions from PostgreSQL 9.4. It seems that compiling from source updated correctly the variable path for postgresql and installed /usr/lib/postgresql/9.4/lib/postgis-2.2.so that wasn't present anymore (for postgis-2.1.so as well), even with (re)installing from apt-get.

希望这会有所帮助.

这篇关于Postgresql:无法访问文件« $libdir/postgis-2.1 »没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆