PostgreSQL error while trying to create extension

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

I get when I try CREATE EXTENSION postgis; can someone tell me why this is so and what can i do to fix it?

+44
database postgresql
Sep 09 '13 at 10:20
source share
14 answers

The following is a working postgis installation on Ubuntu 12.04 (Note: also verified 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 docs at https://wiki.postgresql.org/wiki/Apt

+25
Nov 20 '13 at 11:43
source share

You need to install postgresql-9.1-postgis-scripts . On 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 postgis extensions.

+15
Apr 30 '14 at 21:01
source share

Installing this package did the trick for me in my Linux Mint 16 box:

 # install hstore postgresql extension. sudo apt-get install postgresql-contrib 
+9
Oct. 16 '14 at 18:01
source share

Daniel Believe is close to the truth, but this is not enough. Package missing postgresql-9.1-postgis-2.0 :

 sudo apt-get install postgresql-9.1-postgis-2.0 
+5
Nov 27 '13 at 9:42 on
source share

Presumably, the installed version of postgis is 1.5.x, which is not an extension, but like several SQL scripts that must be manually applied to create the necessary SQL objects.

postgis package is also not enough, it contains only those things that are not dependent on the PG version, you need postgresql-9.1-postgis ( dpkg -L package-name convenient to check files provided by any particular package).

Once the installation paths are known, the official installation documentation should be good enough to set up a template database.

+4
Sep 12 '13 at 14:10
source share

Just decided. You need to remove postgis-1.5. You installed it in PostGIS 2.0. Once you install postgis-2.0 , you will see the patched libraries in the extensions directory. Before installing, you must add the correct repository (see http://docs.pgrouting.org/2.0/en/doc/src/installation/index.html#ubuntu-debian ). Use ppa:ubuntugis/ubuntugis-unstable for PostGIS 2.0. Try one of

 apt-get remove postgis apt-get remove postgresql-9.1-postgis apt-get install postgresql-9.1-postgis 

I could not uninstall and install due to a dependency error. After several attempts, I just deleted postgresql-9.1-postgis and apt-get suggested I upgrade it to 2.0.

+4
Jan 10 '14 at 12:57 on
source share

I had the same problem in my installation of Window 8.1.

I solved this by simply using the Application StackBuilder that comes with Postgres and installs PostGIS again (despite not uninstalling it)

Now works great!

+3
Sep 10 '14 at 14:41
source share

In C: \ Program Files \ PostgreSQL \ 9.4, I found uninstall-postgis-bundle-pg94x64-2.1.5-2.exe. The launch of this fixed problem caused by reinstalling PostgreSQL without first uninstalling it and without installing PostGIS a second time. What happens when you install more than one person.

+3
Mar 26 '15 at 9:18
source share

Make sure you install this

 sudo apt-get install postgresql-9.3-postgis 

I faced the same problem due to the lack of this package.

+2
Sep 24 '14 at 12:34
source share

In 14.04 there is postgresql-9.3-postgis-scripts which contains postgis.control .

+2
Dec 07 '15 at 13:16
source share

CentOS needs a different package for this problem. For CentOS 6, if you use the pgdg yum repository at http://yum.pgdgrpms.org/9.3/redhat/ , install the postgresql93-contrib package using the yum install postgresql93 -contrib command.

Update and edit, if necessary, for PostgreSQL 9.4.

0
Dec 01 '14 at 20:06
source share

I had the worst nightmare when installing Postgis 2.X on SLES 12 SP1. which does not have a compatible package in zypper repo

Here is how it is allowed on my Postgres server instance from 9.4.X

Prerequsite packages that I installed before PostGis based on errors

 Proj 4 Download source cold, Build --> make install install Gdal andjibson by adding zypper repo zypper addrepo http://download.opensuse.org/repositories/Application:Geo/SLE_12_SP1_Backports/Application:Geo.repo zypper install gdal gdal-devel libjson-c-devel libjson 

Postgis Installation

 Download postgis source code (http://download.osgeo.org/postgis/source/postgis-2.3.0rc1.tar.gz) Go to Postgis folder ./configure --with-pgconfig=/usr/lib/postgresql94/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config make make install 

now if you got postgress DB and created postgis extension; he will work

Important for configuration, you must specify the pg-config path and the geo-network path, and you SHOULD NOT include "no raster", since RASTER plays a major role in creating the postgis extension

0
Sep 21 '16 at 5:36
source share

this work is for me

  SELECT PostGIS_full_version(); 

To create postgisis, run the query in the query panel

And to remove postgis from your database, run the following query

  drop extension postgis 
0
May 10 '17 at 10:09 a.m.
source share

if you are using Windows, download postgis.bundle.exe and manually install in C:/(postGreSQLdirectory/version/ ) and that’s it.

0
Nov 01 '17 at 16:00
source share



All Articles