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
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?


  • Are those the exact lines you've entered? Can you double check?
    – BradHards
    Commented Apr 12, 2013 at 23:55
  • which version of postgis?
    – nickves
    Commented Apr 13, 2013 at 0:01
  • I've used the default packages of Fedora 18. Postgis version is 1.5.
    – diegogb
    Commented Apr 13, 2013 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
    Commented Apr 13, 2013 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
    Commented Apr 13, 2013 at 9:14

4 Answers 4


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:


And this post seems to point out the problem:


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



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

  • The error I've posted is already first one. The others are similar.
    – diegogb
    Commented Apr 13, 2013 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
    Commented Apr 13, 2013 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
    Commented Apr 13, 2013 at 12:34

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.

  • 1
    I posted a detailed list of instructions on my web site: diegognesi.it/?p=196.
    – diegogb
    Commented Apr 17, 2013 at 14:57
  • Please write the complete answer here, not just links.
    – steko
    Commented Apr 17, 2013 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
    Commented Apr 17, 2013 at 17:02

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:

  • 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
    Commented Apr 13, 2013 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
    Commented Apr 13, 2013 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. Commented Apr 13, 2013 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.