#5488 closed defect (fixed)
Upgrade from 3.1.1: ERROR: cannot drop function st_clip(raster,integer,geometry,double precision,boolean) because other objects depend on it
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 3.4.1 |
Component: | build | Version: | 2.0.x |
Keywords: | Cc: |
Description
Another case of upgrade trouble:
=# select postgis_extensions_upgrade(); NOTICE: Updating extension postgis from 3.1.1 to 3.4.0 NOTICE: Updating extension postgis_sfcgal from 3.1.1 to 3.4.0 NOTICE: Updating extension postgis_raster from 3.1.1 to 3.4.0 ERROR: cannot drop function st_clip(raster,integer,geometry,double precision,boolean) because other objects depend on it
See also #5484
Change History (11)
comment:1 by , 14 months ago
comment:2 by , 14 months ago
Documentation does not say when signature changed: https://postgis.net/docs/en/RT_ST_Clip.html
comment:3 by , 14 months ago
All the signatures in current master branch for ST_Clip seem to match the signatures in stable-3.0 so these drops must also be coming from 2.x times or earlier
Support for Replaces comment entered the codebase with 3.1 ([3d947448b9c939b321bc22b85c719845722ecc3d/git]) so we can try fixing this bug with a Replaces coment, although it wasn't specifically written for parameters renames.
Support for parameters renames entered the codebase in 3.5.0dev and backport is not necessarely happening, see https://trac.osgeo.org/postgis/ticket/5484#comment:9
comment:4 by , 14 months ago
Same signatures in stable-2.1 as well
The signatures, from 2.1 to current master (3.5.0dev) are:
-- 1 st_clip( rast raster, nband integer[], geom geometry, nodataval double precision[] DEFAULT NULL, crop boolean DEFAULT TRUE ) RETURNS raster -- 2 st_clip( rast raster, nband integer, geom geometry, nodataval double precision, crop boolean DEFAULT TRUE ) RETURNS raster -- 3 st_clip( rast raster, nband integer, geom geometry, crop boolean ) RETURNS raster -- 4 st_clip( rast raster, geom geometry, nodataval double precision[] DEFAULT NULL, crop boolean DEFAULT TRUE ) RETURNS raster -- 5 st_clip( rast raster, geom geometry, nodataval double precision, crop boolean DEFAULT TRUE ) RETURNS raster -- 6 st_clip( rast raster, geom geometry, crop boolean ) RETURNS raster
It would be about time to consolidate more, now that we support Replaces...
comment:5 by , 14 months ago
PostGIS 2.0.0 is the first PostGIS version having raster support integrated. Differences in st_clip signatures from stable-2.0 to stable-2.1 are:
- signature 1 had the "band" parameter renamed to "nband"
- signature 3 had the "band" parameter renamed to "nband"
- a different signature was removed: st_clip(raster, int, geometry, float8[], boolean);
All other signatures were the same from 2.0.0
comment:6 by , 14 months ago
Ok bug confirmed by https://woodie.osgeo.org/repos/30/pipeline/860/9 Next I'll see if the fix is also confirmed
comment:7 by , 14 months ago
I should note that the signature of the function blocking the upgrade did not change in the subject database, so there's really no need to drop it before the upgrade: st_clip(raster,integer,geometry,double precision,boolean)
That drop simply prevents upgrades in presence of views
comment:10 by , 14 months ago
Milestone: | → PostGIS 3.4.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | → 2.0.x |
I'm ok with the backport to 3.4, earlier versions will still have trouble upgrading raster in presence of view. Feel free to reopen if you want a backport.
The current definition of that function in raster/rt_pg/rtpostgis.sql.in is:
The rtpostgis_upgrade_cleanup.sql.in file drops all of these:
Saying, in a comment, that their signature changed (the comment does not say when and how)