【问题标题】:Can not find PostGIS extensions ( installed in a different directory ) and $libdir/postgis-2.3 in mac os在 mac os 中找不到 PostGIS 扩展(安装在不同的目录中)和 $libdir/postgis-2.3
【发布时间】:2017-08-30 18:40:10
【问题描述】:

我在 pycharm 中使用 postgres,但它找不到 postGIS 扩展。它正在寻找他们:/Library/PostgreSQL/9.6/share/postgresql/extension/

但是,当我安装 PostGIS 时,它告诉我:PostGIS extension modules are installed in: /usr/local/share/postgresql/extension

另外一个问题(不知道是不是和第一个有关)是:could not access file "$libdir/postgis-2.3": No such file or directory

【问题讨论】:

  • 你是如何安装 PostGIS 的?
  • 你是否为 postgis 执行了 CREATE EXTENSION 命令
  • 我使用 homebrow 安装它
  • 是的,我收到了这条消息:错误:无法访问文件“$libdir/postgis-2.3”:没有这样的文件或目录
  • 您应该重新安装 postGIS 以修复此错误。在 Ubuntu 中是:sudo apt-get install postgresql-9.6-postgis-2.3

标签: postgresql pycharm postgis


【解决方案1】:

从 PostGIS 2.3.0 升级到 2.4.0 后,我注意到了这个问题。安装 2.4.0 时,我的数据库仍在寻找 2.3.0 库。 解决方案是单独更新数据库以查找 2.4.0 版本:

ALTER EXTENSION postgis UPDATE;
SELECT PostGIS_full_version();

See Upgrading PostGIS section for further details

【讨论】:

  • 在我的情况下,我确实将扩展更新到 2.4,但是当升级到 PG10 时,它抱怨缺少 libdir/postgis-2.3。我发现在 UPDATE 中恰好错过了一个 FUNCTION postgis.geog_brin_inclusion_add_value 并且仍然引用了“$libdir/postgis-2.3”。还不知道我是否只想删除或更改它,但也许这对任何人都有帮助。
【解决方案2】:

我使用 Homebrew 安装并遇到了同样的问题。遵循https://www.linuxquestions.org/questions/fedora-35/problems-to-start-postgresql-with-postgis-after-upgrade-to-fedora-28-a-4175629479/#post5853352的指示后似乎可以解决:

查找 postgis-2.4.so 的位置(例如 /database/postgresql/pgsql-10.0/lib/postgis-2.4.so) 然后创建一个 指向旧名称的符号链接,因此对于我的示例,我会这样做:

ln -s /database/postgresql/pgsql-10.0/lib/postgis-2.4.so /database/postgresql/pgsql-10.0/lib/postgis-2.3.so

对我来说,解决方法是这个确切的命令:

ln -s /usr/local/lib/postgresql/postgis-2.5.so /usr/local/lib/postgresql/postgis-2.3.so

【讨论】:

    猜你喜欢
    • 2020-12-22
    • 1970-01-01
    • 2014-05-08
    • 2021-03-16
    • 1970-01-01
    • 1970-01-01
    • 2018-11-01
    • 2012-09-14
    • 1970-01-01
    相关资源
    最近更新 更多