0

I'm trying to add postgis to a new database I've just created but I get the following error:

I issue the command in pgadmin:

CREATE EXTENSION postgis

I get error:

ERROR:  syntax error at or near "EXTENSION"
LINE 5: CREATE EXTENSION postgis

This is unusual as I have postgis enabled on the other databases on the same server (using postgressql 9.0)?

* UPDATE * Trying the old way I open psql and issue the following commands but nothing happens:

mydatabase=# -f postgis.sql
mydatabase=# -f postgis_comments.sql
mydatabase=# -f spatial_ref_sys.sql

What I'm I doing wrong.

adam78
  • 9,668
  • 24
  • 96
  • 207
  • 1
    `create extension` was introduced in 9.1 –  Jan 08 '19 at 08:56
  • Postgres 9.0 has been [unsupported](https://www.postgresql.org/support/versioning/) for over three years now. You should upgrade to a supported version now, e.g. Postgres 11 or at least Postgres 10 –  Jan 08 '19 at 08:57
  • https://stackoverflow.com/questions/1564056/how-do-i-import-modules-or-install-extensions-in-postgres-8-4 if you can't upgrade it – Daniel E. Jan 08 '19 at 09:00
  • @a_horse_with_no_name I cant upgrade it. – adam78 Jan 08 '19 at 09:08
  • Then you need to install Postgis the old fashioned way: copy the libraries to the correct location and run the SQL script to initialize PostGIS. For details you need to find the installation instructions for the old PostGIS version also as the current PostGIS versions won't work with old Postgres releases. –  Jan 08 '19 at 09:15
  • @a_horse_with_no_name see my update. – adam78 Jan 08 '19 at 09:31

0 Answers0