Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
add comment

2 Answers 2

up vote 1 down vote accepted

you should install postgis ,geos,proj and may be 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
    
I have already installed all the required components, I had to actually locate the file in the /usr/share/postgresql/8.4/contrib/ –  Sam007 Jul 18 '12 at 16:14
    
step1 : cd /usr/share/postgresql/8.4/contrib/ –  francs Jul 18 '12 at 22:13
    
step2: psql -d yourdatabase -f postgis.sql –  francs Jul 18 '12 at 22:13
    
yup already done –  Sam007 Jul 18 '12 at 22:21
add comment

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 located the files in the /usr/share/postgresql/8.4/contrib/ –  Sam007 Jul 18 '12 at 16:15
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.