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've installed PostGIS (ver. 2.0.1) on my Mac using EnterpriseDB's StackBuilder, which I also used for my PostgreSQL (9.2.2) installation. Although StackBuilder says that PostGIS is now installed, and although I have a PostGIS directory in /usr/local/PostgreSQL/9.2/, it doesn't appear to be actually installed (see queries below).

gregory=# select postgis_full_version();
ERROR:  function postgis_full_version() does not exist
LINE 1: select postgis_full_version();
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

gregory=# create extension postgis;
ERROR:  could not open extension control file "/usr/local/PostgreSQL/9.2/share/postgresql/extension/postgis.control": No such file or directory

and select * from pg_available_extensions; does not return a record for PostGIS.

Does anyone know what's up with this and how to get it to work?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

I think you need to load the postgis extension to your database like

CREATE EXTENSION postgis

or load these files to your query window and run them in database

windows default: 
\Program files\Postgresql\8.4\share\contrib\postgis-2.0

postgis.sql
rtpostgis.sql
spatial_ref_sys.sql
topology.sql (if you want topology support)
share|improve this answer
    
Command create extension postgis doesn't find what it needs to run (as noted in original post) and the PostGIS directory tree installed by StackBuilder contains no .sql files. –  pyrogerg Dec 19 '12 at 14:03
    
Have you tried to search those files from hard disk ? –  simplexio Dec 19 '12 at 14:09
    
I just found the following files. Should I run them all (except the uninstalls) and does order matter? legacy.sql postgis_comments.sql rtpostgis.sql spatial_ref_sys.sql topology‌​_upgrade_20_minor.sql uninstall_rtpostgis.sql legacy_minimal.sql postgis_upgrade_20_minor.sql rtpostgis_legacy.sql topology.‌​sql uninstall_legacy.sql uninstall_topology.sql postgis.sql raster_comments.sql rtpostgis_upgrade_20_minor.sql topology_comme‌​nts.sql uninstall_postgis.sql –  pyrogerg Dec 19 '12 at 23:06
    
in mentioned order –  simplexio Dec 20 '12 at 8:04
add comment

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.