【问题标题】:how to change install postgis location? postgres如何更改安装 postgis 的位置? postgres
【发布时间】:2017-05-30 16:33:27
【问题描述】:

当我在我的 postgres 数据库中并尝试为我的数据库创建扩展时,我收到此错误

ERROR: could not open extension control file "/usr/share/postgresql/9.5/extension/postgis.control": No such file or directory

我知道有很多关于这个错误和解决方案的帖子,我也都试过了。在 stackoverflow 中找到了很多,但没有一个有效。

我意识到在我的postgresql 目录中有9.2,9.3,9.4,9.5,9.6,

进入错误目录,发现9.5里面真的没有postgis.control

我检查了我的 psql 版本并显示 9.6.1

我进入了9.6 文件夹,我确实在其中看到了postgis.control。

我想更改安装目录,所以当我运行时

create extension postgis

会过去的

"/usr/share/postgresql/9.6/extension/postgis.control"

而不是

"/usr/share/postgresql/9.5/extension/postgis.control"

有人可以帮帮我吗?

提前致谢。

附:使用 Ubuntu 14.04 并且还有 Ubuntu 16.04 作为桌面,我还没有尝试安装 postgis

【问题讨论】:

标签: database postgresql ubuntu postgis


【解决方案1】:

您应该使用以下命令:

sudo apt-get install postgresql-9.6-postgis-scripts

【讨论】:

  • 在最近的 ubuntu 上,即使 sudo apt install postgis 也可以工作 - 它安装了所有需要的库,这些库与已安装的 postgres 版本一起工作。
【解决方案2】:

使用以下命令在您的 9.5 版本目录中获取 :

sudo apt install postgis postgresql-9.5-postgis-2.3

【讨论】:

    猜你喜欢
    • 2015-12-05
    • 1970-01-01
    • 1970-01-01
    • 2021-10-03
    • 2018-04-15
    • 1970-01-01
    • 1970-01-01
    • 2020-04-19
    • 1970-01-01
    相关资源
    最近更新 更多