[postgis-tickets] [PostGIS] #5486: Upgrade from 3.2.1 fails due to deprecating two flavors of st_dwithin

PostGIS trac at osgeo.org
Mon Aug 28 09:42:06 PDT 2023


#5486: Upgrade from 3.2.1  fails due to deprecating two flavors of st_dwithin
------------------------------------+---------------------------
  Reporter:  strk                   |      Owner:  strk
      Type:  defect                 |     Status:  new
  Priority:  medium                 |  Milestone:  PostGIS 3.3.5
 Component:  build/upgrade/install  |    Version:  3.3.x
Resolution:                         |   Keywords:
------------------------------------+---------------------------
Comment (by strk):

 Running in the trisquel docker container used by Woodie:
 {{{
 postgis_reg=# create extension postgis version '2.5.7';
 CREATE EXTENSION
 postgis_reg=# select oid::regprocedure from pg_proc where proname =
 'st_dwithin';
                             oid
 ------------------------------------------------------------
  st_dwithin(text,text,double precision)
  st_dwithin(geometry,geometry,double precision)
  st_dwithin(geography,geography,double precision)
  st_dwithin(raster,raster,double precision)
  st_dwithin(geography,geography,double precision,boolean)
  st_dwithin(raster,integer,raster,integer,double precision)
 (6 rows)
 postgis_reg=# create view v1 as select st_dwithin(null::text, null::text,
 null::float8);
 CREATE VIEW
 postgis_reg=# create view v2 as select st_dwithin(null::geography,
 null::geography, null::float8);
 CREATE VIEW
 postgis_reg=# alter extension postgis update to '3.3.2';
 WARNING:  unpackaging raster
 WARNING:  PostGIS Raster functionality has been unpackaged
 HINT:  type `SELECT postgis_extensions_upgrade();` to finish the upgrade.
 After upgrading, if you want to drop raster, run: DROP EXTENSION
 postgis_raster;
 WARNING:  Deprecated function
 st_dwithin_deprecated_by_postgis_300(text,text,double precision) left
 behind: cannot drop function
 st_dwithin_deprecated_by_postgis_300(text,text,double precision) because
 other objects depend on it
 DETAIL:  view v1 depends on function
 st_dwithin_deprecated_by_postgis_300(text,text,double precision)
 HINT:  Replace the view changing all occurrences of
 st_dwithin_deprecated_by_postgis_300(text,text,double precision) in its
 definition with st_dwithin and upgrade again
 WARNING:  Deprecated function
 st_dwithin_deprecated_by_postgis_300(geography,geography,double precision)
 left behind: cannot drop function
 st_dwithin_deprecated_by_postgis_300(geography,geography,double precision)
 because other objects depend on it
 DETAIL:  view v2 depends on function
 st_dwithin_deprecated_by_postgis_300(geography,geography,double precision)
 HINT:  Replace the view changing all occurrences of
 st_dwithin_deprecated_by_postgis_300(geography,geography,double precision)
 in its definition with st_dwithin and upgrade again
 ALTER EXTENSION
 }}}

 Interestingly there seem to be no problem with having two deprectated
 function with the same name but different type arguments. So my problem
 must have been really due to something else, and specifically to a broken
 system whereas to go from version A to version B in presence of a view
 we're hitting two upgrades instead of one, which try to deprecate the same
 function twice, resulting in an attempt to run the SAME alter more than
 once.


 I guess I'll mark this ticket as invalid or maybe it can become a ticket
 about idempotency of an upgrade step. In other words: should we allow
 running `postgis_extensions_upgrade()` twice in the same database where a
 view is defined using deprecated functions ? Right now doing so will error
 out the second time, with this hard-to-understand error.

 We could maybe just improve the error to hint about the possibility that
 upgrade issues need be fixed before further upgrading
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5486#comment:12>
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