Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a spatially enabled PostGIS database by following the PostGIS documentation.

In the short version, i executed,

createdb yourdatabase
createlang plpgsql yourdatabase

But I did not execute the last three commands,

psql -d yourdatabase -f postgis.sql
psql -d yourdatabase -f postgis_comments.sql
psql -d yourdatabase -f spatial_ref_sys.sql

Is my database still spatially enabled? If not, then can you tell me where these .sql files are located so I can execute those last commands, since I am getting the following error,

postgis.sql: No such file or directory

I am using Ubuntu 12.04.

share|improve this question
up vote 1 down vote accepted

You should install PostGIS, GEOS, Proj and maybe other components first. If you install PostGIS successfully, the postgis.sql, postgis_comments.sql, spatial_ref_sys.sql will locate the $PGHOME/share/contrib directory.

share|improve this answer

You must install the PostGIS functions, data types, etc. before you can use PostGIS. This can be found in these three SQL-files. Set the correct path to the files and execute them in PostgreSQL by using psql.

share|improve this answer

I found the geodjango documentation really good.

They have given step by step explanation on installing postgis and dependencies. You can consult the postgis documentation or other sources when instructions are django specific.

share|improve this answer
Thanks, but you've basically added a link-only answer which we don't like here because they break over time. Please add stand-alone answers, though supporting links are fine. – Colin 't Hart Apr 24 at 11:50
@Colin'tHart I totally agree with you. I considered to post entire content, but posted the links because size of content was too large and it belongs to django, so chances are thin that this content will be removed. Will improve the answer. But right now, detailed answer has more than 2 links I need more than 10 repo points for that. – Ashish Rana Apr 24 at 13:36

Your Answer


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.