ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/postgis.control": No such file or directory
Is what I get when I try to CREATE EXTENSION postgis;
can anybody tell me why is it so and what can I do to fix it?
Description. CREATE EXTENSION loads a new extension into the current database. There must not be an extension of the same name already loaded. Loading an extension essentially amounts to running the extension's script file.
Listing Installed Extensions Get a list of all the extensions installed on a database by using the \dx command. For example, the output for \dx when run on the Databases for PostgreSQL default database shows the only installed extension.
Click the Definition tab to continue. Use the Definition tab to select the Schema and Version: Use the drop-down listbox next to Schema to select the name of the schema in which to install the extension's objects. Use the drop-down listbox next to Version to select the version of the extension to install.
The following will get you a working postgis install on Ubuntu 12.04 (Note: also tested on 13.10)
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/postgis.list
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-9.3-postgis-2.1 postgresql-client-9.3
sudo -u postgres psql -c 'create extension postgis;'
Based on the docs at https://wiki.postgresql.org/wiki/Apt
You need to install postgresql-9.1-postgis-scripts
. In Ubuntu or Debian, you need to run the following command as root:
apt-get install postgresql-9.1-postgis-scripts
This adds the files needed to create the postgis
extensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With