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.

Just installed PostgreSql and PostGIS over a brand new installation of Fedora 18. I did it this way:

sudo yum install postgresql postgresql-server postgrsql-contrib postgresql-devel pgadmin3

Once installed PostgreSql, I created the postgres user as usual.

Then, I installed PostGIS:

sudo yum install proj-devel gdal postgis

As a last step, I've created a new user (mydbuser) and a new db owned by that user:

psql -U postgres -W
CREATE DATABASE mydb OWNER mydbuser;
\q
createlang plpgsql mydb

Now, I've tried to execute the following line to use PostGIS on mydb:

psql -d mydb -U mydbuser -W -f /usr/share/pgsql/contrib/postgis-64.sql

but I get a long list of errors of the same type, this is the first line:

psql:/usr/share/pgsql/contrib/postgis-64.sql:7751: ERRORE:  il tipo "geometry" non esiste

In English, the message is 'ERROR: "geometry" type does not exist'. I've also tried to execute the code as the postgres user, but nothing changed. Any ideas?

Diego

share|improve this question
    
Are those the exact lines you've entered? Can you double check? –  BradHards Apr 12 '13 at 23:55
    
which version of postgis? –  nickves Apr 13 '13 at 0:01
    
I've used the default packages of Fedora 18. Postgis version is 1.5. –  diegogb Apr 13 '13 at 8:54
    
@BradHards Now I'm going to check, removing all the packages and doing it all again, meanwhile I've edited the post and added the createlang statement, that I executed as required by the postgis manual but I forgot to write. –  diegogb Apr 13 '13 at 9:01
    
@BradHards I removed the postgis package and installed it again, then I tried tcreate a new post database owned by the postgres user, but the error I get is still the same. –  diegogb Apr 13 '13 at 9:14

4 Answers 4

up vote 1 down vote accepted

If the old/incompatible version of PostGIS is to blame, install PostGIS 2.0 from PGDG. Use the PGDG YUM RPM method, described here: http://wiki.postgresql.org/wiki/YUM_Installation with package postgis2. There is an older guideline here to help out.

share|improve this answer
    
Nice page, thank you! –  diegogb Apr 13 '13 at 17:54
1  
I posted a detailed list of instructions on my web site: diegognesi.it/?p=196. –  diegogb Apr 17 '13 at 14:57
    
Please write the complete answer here, not just links. –  steko Apr 17 '13 at 15:25
    
@steko: sorry for linking a page in my own blog, I did it because the real and precise solution to the problem is the one already linked by Mike (from the postgresql wiki). My page is only a sort of step-by-step guide about setting up PostgreSQL and PostGIS 2 on Fedora 18, and goes out of the scope of my original question. I linked it only for completeness. –  diegogb Apr 17 '13 at 17:02

The problem is in Fedora 18 itself. Default repos will install postgis 1.5 and potgresql 9.2.4, but this two versions are not compatible. This is the compatibility table:

http://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS

And this post seems to point out the problem:

http://postgis.17.x6.nabble.com/F18-Postgresql-9-2-x-PostGIS-1-5-x-issues-td5002414.html

...And an update ha been planned for Fedora 18 in order to resolve this issue:

https://admin.fedoraproject.org/updates/player-3.0.2-24.fc18,gdal-1.9.1-15.fc18.1,grass-6.4.2-5.fc18,geos-3.3.7-1.fc18,postgis-2.0.2-2.fc18

share|improve this answer

This is very similar to another question on SO. Add -v ON_ERROR_STOP=1 to the psql command to see the first error.

share|improve this answer
    
The error I've posted is already first one. The others are similar. –  diegogb Apr 13 '13 at 8:46
1  
How did you determine it was the first error? It shouldn't be possible. The first error is the only useful error, all others are just noise. –  Mike T Apr 13 '13 at 11:28
    
I red the output text from the beginning to the end and taken the first error. If I use the ON_ERROR_STOP=1 option, the error is "C" language does not exist, as documented in the second link posted in my solution. –  diegogb Apr 13 '13 at 12:34

According to the manual you should either create the db from template:

CREATE DATABASE my_spatial_db TEMPLATE=template_postgis

Or add an extension in your database:

CREATE EXTENSION postgis;
share|improve this answer
    
Both the lines return an error. The first one returns: ERRORE: il modello di database "template_postgis" non esiste (en: ERROR: database model "template_postgis" does not exist); –  diegogb Apr 13 '13 at 8:52
    
...the second one returns: ERRORE: apertura del file di controllo dell'estensione "/usr/share/pgsql/extension/postgis.control" fallita: File o directory non esistente (en: the specified file or directory for the extension does not exist). –  diegogb Apr 13 '13 at 8:53
1  
@diegogb I don't have a clue then, sorry. But I can tell you that SET lc_messages TO 'en_US.UTF-8'; will change the error messages to english so at least that might be a bit help. –  Jakub Kania Apr 13 '13 at 9:34

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.