[postgis-devel] [postgis-tickets] r16847 - Revise postgis_extensions_upgrade to repackage raster if it finds it unpackaged. Revise unpackage notice to say to give instruction to call the postgis_extensions_upgrade function and repackage.

Regina Obe lr at pcorp.us
Fri Sep 28 11:43:05 PDT 2018


> 
> On Thu, Sep 27, 2018 at 02:50:36AM +0000, Regina Obe wrote:
> > Author: robe
> > Date: 2018-09-27 14:50:36 -0700 (Thu, 27 Sep 2018) New Revision: 16847
> >
> > Modified:
> >    trunk/extensions/postgis/unpackage_raster_if_needed.sql
> >    trunk/postgis/postgis.sql.in
> > Log:
> > Revise postgis_extensions_upgrade to repackage raster if it finds it
> unpackaged.  Revise unpackage notice to say to give instruction to call the
> postgis_extensions_upgrade function and repackage.
> 
> I don't like this change.
> 
> Reasons:
> 
> 1. It makes `postgis_extensions_upgrade` function do more than it was
>    meant to do (automatically package unpackaged code) and do it partially
>    (only does for raster, not for other postgis extensions, and it is not
>    documented to do it).
[Regina Obe] 

It is meant to upgrade extensions, repackaging raster functions as part of postgis_raster 
I think falls in the extension upgrade category and it doesn't need to be done for other extensions because other extensions were always self-standing.
If you had installed postgis with extension support presumably you'd want raster to be repackaged as an extension.
Note it only does this if it notices you have postgis installed as an extension and have unpackaged raster functions.

I'll update the documentation accordingly.

> 
> 2. It makes life of people who cannot (or don't want to) build PostGIS
>    with raster support harder because they cannot re-package raster
>    while they could just uninstall the unpackaged via script
>    (instructions of doing which were removed in this commit)
> 
> 3. It asks people to use a function meant to upgrade for doing a
>    different thing (repackage) when there's a clean standard syntax
>    to do that already.
> 
> What was the reason for this change, exactly ? I would revert it.
> 
> --strk;
[Regina Obe] 
The script checks before running to see if you had postgis packaged and you have raster functions unpackaged.  Presumably if you started off with postgis unpackaged 
And decided to have it packaged, you would want postgis_raster to be packaged as well.

So are you thinking of those people who - built with raster support in say 2.5.0, then built with PostGIS 3.0.0 support without raster?
I suspect there will be very few of those folks.  

I suppose we can put the uninstall_rtpostgis.sql instructions back at the end, but I'd prefer we have a solution that works for everyone without caveats.

A solution to that problem might be to have a 

CREATE EXTENSION postgis_raster FROM unpackaged;

For people who don't have raster installed but currently have raster functions, which doesn't try to do a raster upgrade as well.
In that case, you can even just drop the raster functions for them, because they won't be able to use them anyway. :)

This would also have the benefit of working for people who have cloud platforms, but the cloud provider decided in 3.0 to no longer support raster.
In such cases, people won't be able to use the uninstall_rtpostgis.sql script anyway since they don't have access to the file system and dbaas tend to have pseudo super user rights that doesn't allow running scripts that drop C functions.

Thanks,
Regina



More information about the postgis-devel mailing list