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

查看:517
本文介绍了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»没有此类文件或目录

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天全站免登陆