[GIS] How to fix “spatial_ref_sys relation does not exist”

postgis

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

Best Answer

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
Related Question