postgresql 如何更改安装postgis的位置?postgres
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41666196/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to change install postgis location? postgres
提问by Tsuna
When I am in my postgres db and tried to create an extension for my db, I get this error
当我在我的 postgres 数据库中并尝试为我的数据库创建扩展时,我收到此错误
ERROR: could not open extension control file "/usr/share/postgresql/9.5/extension/postgis.control": No such file or directory
ERROR: could not open extension control file "/usr/share/postgresql/9.5/extension/postgis.control": No such file or directory
I know there are so many posts out there with this error and solutions and I tried them all too. Found so much in stackoverflow but none of them worked.
我知道有很多帖子都有这个错误和解决方案,我也都试过了。在 stackoverflow 中发现了很多,但没有一个起作用。
I realized in my postgresql
directory there are 9.2
, 9.3
, 9.4
, 9.5
, 9.6
,
我意识到在我的postgresql
目录中有9.2
, 9.3
, 9.4
, 9.5
, 9.6
,
I went into the directory in the error and I realized there is really no postgis.control
inside 9.5
我走进错误的目录,然后我意识到真的没有postgis.control
内9.5
I checked my psql version and showed 9.6.1
我检查了我的 psql 版本并显示了 9.6.1
I went into 9.6
folder and I DO see a postgis.control
in it.
我进入9.6
文件夹,我postgis.control
确实在其中看到了一个。
I want to changed the installation directory so when i run
我想更改安装目录,所以当我运行时
create extension postgis
create extension postgis
it would go
它会去
"/usr/share/postgresql/9.6/extension/postgis.control"
"/usr/share/postgresql/9.6/extension/postgis.control"
instead of
代替
"/usr/share/postgresql/9.5/extension/postgis.control"
"/usr/share/postgresql/9.5/extension/postgis.control"
Can someone please give me a hand?
有人可以帮我一把吗?
Thanks in advance.
提前致谢。
P.S. Using Ubuntu 14.04 and also have Ubuntu 16.04 as desktop which I haven't try to install postgis yet
PS 使用 Ubuntu 14.04 并且还有 Ubuntu 16.04 作为桌面,我还没有尝试安装 postgis
回答by Venkatesh Lokare
You should use the following command:
您应该使用以下命令:
sudo apt-get install postgresql-9.6-postgis-scripts
回答by Abdulsatar Aboud
Use the following command to get the postgis.controlin your 9.5 version directory:
使用以下命令获取9.5 版本目录中的postgis.control:
sudo apt install postgis postgresql-9.5-postgis-2.3
须藤 apt 安装 postgis postgresql-9.5-postgis-2.3