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 am trying to install postgis in my database. I compiled the library successfully. Now when I try to import the sql spatial_ref_sys is shows the error that

spatial_ref_sys relation does not exist

When I looked into the sql, it has no create table at the top. What should I do. Am I supposed to have these two tables geometry_columns and spatial_ref_sys from other sources. I just created a database mydatabase and tried to import the spatial_ref_sys.sql into it. Any suggestions? The version of my postgresql is 9.1.3 and the version of my postgis is 2.0.0

share|improve this question
1  
Did you execute postgis.sql first? (name might be slightly different) –  underdark May 31 '12 at 14:34
    
Yeah I found it and it executed successfully. Thanks. However it didn't create the geometry_columns table which it was supposed to isn't it? –  rajan sthapit May 31 '12 at 14:41
1  
if it helps at all, geometry_columns is a view in 2.0, not a table –  rec.thegeom May 31 '12 at 17:19
add comment

3 Answers

up vote 5 down vote accepted

Did you also execute spatial_ref_sys.sql ?

share|improve this answer
    
Yes, I did, but it didn't create the geometry_columns table –  rajan sthapit May 31 '12 at 16:15
    
Look through the two forementioned sql files and find where the spatial_ref_sys is being created. Is it not listed in either script? If it is, then there's an issue with the way you're running it. –  Jmoney38 May 31 '12 at 16:17
    
This issue is fixed –  rajan sthapit May 31 '12 at 19:54
    
Why don't you actually contribute to the collaborative solution rajan and post a tutorial –  boulder_ruby Sep 10 '13 at 4:29
add comment

One other point that may help somebody else... Make sure you're actually in the database which has had the GIS extensions added before you try to grant privileges on it!

$ psql geodjango
psql (9.1.6)
Type "help" for help.

geodjango=# grant select,insert,update,delete on spatial_ref_sys to postgres;
GRANT
share|improve this answer
add comment

You need to install postgis first. Then dont forget to create extension postgis on your database.

PQSL

\c gis; --Connect to gis database CREATE EXTENSION postgis;

share|improve this answer
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.