how to change install postgis location? postgres

怎甘沉沦 提交于 2019-12-20 11:52:31

问题


When I am in my postgres db and tried to create an extension for my db, I get this error

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.

I realized in my postgresql directory there are 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

I checked my psql version and showed 9.6.1

I went into 9.6 folder and I DO see a postgis.control in it.

I want to changed the installation directory so when i run

create extension postgis

it would go

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

instead of

"/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


回答1:


You should use the following command:

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



回答2:


Use the following command to get the postgis.control in your 9.5 version directory:

sudo apt install postgis postgresql-9.5-postgis-2.3



来源:https://stackoverflow.com/questions/41666196/how-to-change-install-postgis-location-postgres

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!