5

I have a postgres 9.1 database with postgis 2.1, and I recently needed to add sfcgal to it, so i rebuilt postgis 2.1, but I can't find out how to update the postgis extension in postgres without dropping all data. Is there a way to do that ?

ALTER EXTENSION postgis UPDATE;

returns a notice saying i'm already at version 2.1.0

Thanks for any tips

Cactusbone
  • 213
  • 2
  • 9

2 Answers2

6

from the NEWS files in postgis repository, it seems that with postgis 2.2.0, SFCGAL can now be installed as its own extension using CREATE EXTENSION postgis_sfcgal

so this will be easier in the future ! :)

Cactusbone
  • 213
  • 2
  • 9
4

just run the sfcgal.sql file into your existing database. Unfortunately, cgal is not packaged as an extension (actually, for exactly the reason your case demonstrates: you can't have two extensions with the same version and different capabilities).

Paul Ramsey
  • 19,865
  • 1
  • 47
  • 57
  • May I suggest you clarify your answer by adding the commands psql -d database_name -a -f /usr/local/Cellar/postgis/2.1.7_1/share/postgis/sfcgal.sql and ALTER EXTENSION postgis UPDATE;? Otherwise nice answer ;) I think the other answer will be more relevant in the future. – n1000 Oct 13 '15 at 09:57