Postgis installation: type "geometry" does not exist

yetty picture yetty · Jul 27, 2011 · Viewed 71.3k times · Source

I am trying to create table with Postgis. I do it by this page. But when I import postgis.sql file, I get a lot of errors:

ERROR:  type "geometry" does not exist

Does anybody know how can I fix it?

Answer

Krishna Sapkota picture Krishna Sapkota · Jan 7, 2014

I had the same problem, but it was fixed by running following code

CREATE EXTENSION postgis;

In detail,

  1. open pgAdmin
  2. select (click) your database
  3. click "SQL" icon on the bar
  4. run "CREATE EXTENSION postgis;" code