[postgis-devel] script to unpackage raster functions from postgis extension

Regina Obe lr at pcorp.us
Sat Oct 7 09:16:03 PDT 2017


In past, I just put the drop in a do loop to get around the lack of IF EXISTS


WHEN ... 

Look at the helper function drop_if_exists --  https://git.osgeo.org/gogs/postgis/postgis/src/svn-trunk/extensions/postgis_extension_helper.sql#L62

That's what I created it for, for this very reason (though recently it seems dropping a function also drops it from extension, so not quite necessary anymore)

If you don't like ignoring all errors, you can tweak the function to ignore only specific errors.

-----Original Message-----
From: postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] On Behalf Of Sandro Santilli
Sent: Saturday, October 07, 2017 11:44 AM
To: postgis-devel at lists.osgeo.org
Subject: [postgis-devel] script to unpackage raster functions from postgis extension

While working on the experimental "postgis_raster" extension split from "postgis", a big road block is being able to tell apart raster objects from core objects when it comes to remove them from extension being upgraded.

This is hard because:

  1) We need to drop any current or past object
     Hopefully known by analyzing:
      - rtpostgis_upgrade_cleanup.sql (past)
      - rtpostgis_drop.sql (past)
      - uninstall_rtpostgis.sql (current)
     Or using signatures in the bottom of postgis_restore.pl ?

  2) We can only drop if the function is there
     No "IF EXISTS" is available for ALTER EXTENSION DROP

For these reasons I'm thinking about adding another of our perl creators for "extension opt-out", how does it sound ?


  ()   Free GIS & Flash consultant/developer
  /\   https://strk.kbt.io/services.html
postgis-devel mailing list
postgis-devel at lists.osgeo.org

More information about the postgis-devel mailing list