Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have installed PostgreSQL 9.x and PostGIS 1.5/2.0 several times and have never had this problem.

I just got a new CentOS 6.3 server up and running and and I have Postgres 9.3 functioning as expected. I have run

yum install postgis2_93

and I can see the files in

/usr/pgsql-9.3/share/contrib/

however, when I run

CREATE EXTENSION postgis;

I receive

ERROR:  could not open extension control file "/usr/pgsql-9.3/share/extension/postgis.control": No such file or directory

the tutorials (#1, #2) I have used don't show any steps between installing PostGIS and creating the extension.

What am I missing?

share|improve this question
    
What you're missing is 'postgis.control' :) The question is 'why' or 'where'. First, see if you even have a copy by running 'find /usr -name postgis.control'. If you don't, then it's a packaging problem with the brand new postgis2_93 package that needs to be fixed. –  Paul Ramsey Sep 12 '13 at 17:06
    
Oh, you can see the files (including 'postgis.control'?) share/contrib, but from the error message pgsql is looking in share/extension. There might have been a change in default extension location from 9.2 to 9.3 that the packager missed. –  Paul Ramsey Sep 12 '13 at 17:07
    
@PaulRamsey - I ran find /usr -name postgis.control and it is not present. I can see some files in share/contrib; however, postgis.control is not among them... what do you suggest I do? wait for a fix, make my own, something else? –  losthorse Sep 12 '13 at 17:42
    
@PaulRamsey - I just verified that postgis-2.1.so is present in /lib does this mean I can just make my own postgis.control file? –  losthorse Sep 12 '13 at 18:00
    
If you can find a postgis.sql file, you can run that into your database (and the spatial_ref_sys.sql file) to manually spatialize your database. Report the missing control file to the packager, that's a big problem. –  Paul Ramsey Sep 13 '13 at 16:42

2 Answers 2

up vote 1 down vote accepted

If you can find a postgis.sql file, you can run that into your database (and the spatial_ref_sys.sql file) to manually spatialize your database. Report the missing control file to the packager, that's a big problem.

share|improve this answer

I just had the same problem on Ubuntu Server 14.04. I installed postgis extension from the official ubuntu repositories. So I used # apt-get install postgis.

Then, find /usr -name postgis.control didn't return any result.

The reason was extension/postgis.control wasn't installed because of postgis-scripts wasn't.

$ aptitude search postgis
i   libpostgis-java                                  - Geographic objects support for PostgreSQL -- JDBC support 
i   postgis                                          - Geographic objects support for PostgreSQL                 
p   postgis:i386                                     - Geographic objects support for PostgreSQL                 
i   postgis-doc                                      - Geographic objects support for PostgreSQL -- documentation
i   postgresql-9.3-postgis-2.1                       - Geographic objects support for PostgreSQL 9.3             
p   postgresql-9.3-postgis-2.1:i386                  - Geographic objects support for PostgreSQL 9.3             
i   postgresql-9.3-postgis-2.1-scripts               - PostGIS for PostgreSQL 9.3 -- scripts -- dummy package    
i   postgresql-9.3-postgis-scripts                   - Geographic objects support for PostgreSQL 9.3 -- scripts 

The solution is to install it.

On debian likes distros :

# apt-get install postgis*

The aptitude package manager will determinate automaticaly the correct package versions to install. The postgis-doc will be installed too.

You can check to succes of the operation running the following command :

$ find /usr -name postgis.control

On my server, it returns now :

/usr/share/postgresql/9.3/extension/postgis.control

You can now enable the extension on any database on your postgres server :

  • connect to your db with superuser (postgres by default)
  • run CREATE EXTENSION postgis;

Your public shema now contains all postgis object and functions.

share|improve this answer
    
...wish you had Windows direction too –  Imray Sep 10 at 14:38
    
...never mind! Solved it in Windows by reinstalling PostGIS via StackBuilder –  Imray Sep 10 at 14:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.