16

When I try to enable the postgis extension in postgresql on windows I get the following error:

syntax error at or near "PARALLEL"

I have been looking, but cannot find anyone with this error. Any help?

Jens de Bruijn
  • 939
  • 9
  • 25
  • 7
    It seems you are using a PostGIS version that is intended for Postgres 9.6 but you are using an earlier Postgres version. –  Oct 12 '16 at 09:02

3 Answers3

6

While I had PostgreSQL 9.5 installed, I was using PostGIS intended for version 9.6. This caused the error.

Credits to a_horse_with_no_name

Community
  • 1
  • 1
Jens de Bruijn
  • 939
  • 9
  • 25
  • You can use [Pex](https://github.com/petere/pex) to install a version of PostGIS that matches your existing postgres version. – ejoubaud Apr 27 '17 at 13:54
5

I just had the same error and solved it with the good old restart procedure:

# install or upgrade postgres and postgis
brew upgrade postgres
brew upgrade postgis

# drop extension in case of an update
DROP EXTENSION postgis

# restart postgres
pg_ctl -D /usr/local/var/postgres stop -s -m fast
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

# create extension
CREATE EXTENSION postgis

I think restarting postgres was the important step to resolve the issue.

baltendo
  • 51
  • 6
  • a_horse_with_no_name mentioned as a comment below my answer, the problem is the version mismatch. The upgrade commands you use probably solve the problem rather than the restart – Jens de Bruijn Dec 01 '16 at 12:50
  • I was getting this error but *without* a version mismatch. Restarting the PostgreSQL 'cluster' (server instance) fixed it. – Kenny Evitt Feb 14 '20 at 21:37
0
brew postgresql-upgrade-database

I had an old version of Postgres. This did solve the problem on osx.

piyer
  • 746
  • 4
  • 11