问题
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