[postgis-tickets] [PostGIS] #3896: postgis_extensions_upgrade function to upgrade all your packaged postgis extensions

PostGIS trac at osgeo.org
Wed Oct 11 08:18:10 PDT 2017


#3896: postgis_extensions_upgrade function to upgrade all your packaged postgis
extensions
------------------------------------+---------------------------
  Reporter:  robe                   |      Owner:  strk
      Type:  enhancement            |     Status:  new
  Priority:  medium                 |  Milestone:  PostGIS 2.5.0
 Component:  build/upgrade/install  |    Version:  trunk
Resolution:                         |   Keywords:
------------------------------------+---------------------------

Comment (by robe):

 strk the noraster replace, is so it can just compare the version part.

 So if you are at 2.5.0noraster, then you shouldn't be upgrade to 2.5.0.

 If you are at 2.5.0noraster and new version is 2.6.0, then you should be
 upgraded to 2.6.0noraster regardless of what the postgis.control file
 says.

 Similarly if you were at 2.5.0 and your postgis.control default is
 2.6.0noraster, you should be upgraded to 2.6.0 (so you still have your
 raster functionality).

 I'm thinking once we have this in place, we could actually switch the
 default at 2.6.0 to the noraster version without paying any penalty.

 Because only users creating from scratch would have the noraster version.
 Existing users would continue to have the regular version unless they
 didn't use this function, in which case when they do.


 {{{
 ALTER EXTENSION postgis UPDATE;

 }}}

 Our update script would look to see if raster_columns is empty, and if it
 is, it would throw an error naturally because it can't drop raster support
 if tables rely on it.

 Otherwise it would just drop with a notice saying


 {{{
 We noticed you are not using raster, we have dropped it for you.
 If you want it back, run

 CREATE EXTENSION postgis VERSION "2.6.0";
 }}}


 At that point we could even call it "2.6.0withraster"

 Then come 3.0 the task of splitting the two extensions will be much easier
 and no one would notice because we'd have gotten everyone used to using
 our helper function and we can do anything we want in the function like
 -- have a dummy postgis_raster extension with nothing in it and manually
 move raster functions/data by querying the postgis extension catalog.  So
 the extension would be called postgis_raster VERSION "3.0.0presplit"; and
 have nothing in it.

 and then ALTER EXTENSION postgis_raster UPDATE VERSION "3.0.0"  would
 update all the functions, types etc in it using our regular script.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3896#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list