Opened 8 months ago

Closed 8 months ago

#5494 closed defect (fixed)

st_dwithin(text,text,float8) is marked as deprecated and installed by the same postgis version

Reported by: strk Owned by: pramsey
Priority: critical Milestone: PostGIS 3.1.10
Component: postgis Version: master
Keywords: upgrade, deprecation, st_dwithin Cc:

Description

See this:

postgis_reg=# create extension postgis version '3.4.0';
CREATE EXTENSION
postgis_reg=# select oid::regprocedure, proargnames from pg_proc where proname = 'st_dwithin';
                           oid                            |             proargnames              
----------------------------------------------------------+--------------------------------------
 st_dwithin(text,text,double precision)                   | 
 st_dwithin(geometry,geometry,double precision)           | {geom1,geom2,""}
 st_dwithin(geography,geography,double precision,boolean) | {geog1,geog2,tolerance,use_spheroid}
(3 rows)
postgis_reg=# create view lockit as select st_dwithin(null::text, null::text, null::float8);
CREATE VIEW
postgis_reg=# alter extension postgis update to 'ANY';
ALTER EXTENSION
postgis_reg=# alter extension postgis update to '3.4.0';
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 lockit 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
ALTER EXTENSION

What's happening is that the script to upgrade to 3.4.0 is saying that PostGIS-3.0.0 deprecated the ST_DWithin(text,text,float8) function, but this is clearly not the case, as PostGIS-3.4.0 is providing it !

This was initially reported as #5486 bot it's now more clear

Change History (12)

comment:1 by strk, 8 months ago

The Replaces st_dwithin(text,text,float8) comments are in all branches from 3.1 to current master (3.5dev) and the commits adding them all reference ticket #5035

Specifically the replacement tag entered versions 3.3.0(to 3.3.4), 3.2.1(to 3.2.5), 3.1.5(to 3.1.9)

The ticket only complained about ST_DWithin(geography,geography, double precision) so the version taking text was overzelous, and possibly wrong, I'll dig to find out.

comment:2 by strk, 8 months ago

Milestone: PostGIS 3.4.1PostGIS 3.1.10
Version: 3.4.xmaster

The ST_DWithin(text, text, float8) signature is defined in postgis/geography.sql.in at least since postgis-1.5 and it doesn't look like having ever be deprecated, so those commits were plain wrong.

Fix needs to be backported up to 3.1 branch

comment:3 by strk, 8 months ago

To complicate things, multiple definitions of ST_DWithin exist depending on the version of PostgreSQL PostGIS was compiled against.

For example in stable-3.1 we have:

#if POSTGIS_PGSQL_VERSION >= 120
...
-- Availability: 1.3.4
-- Replaces ST_DWithin(text, text, float8) deprecated in 3.0.0
CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry,float8)
...
#else
-- Availability: 1.2.2
CREATE OR REPLACE FUNCTION ST_DWithin(geom1 geometry, geom2 geometry, float8)
...
#endif

comment:4 by strk, 8 months ago

I've verified 1.3.0 already had the function taking geometry, so the 1.3.4 line is wrong. I can say 1.2.1 did not have it and 1.2.2 did not exist so the availabilty line should say 1.3.0, where it had no parameter names.

comment:5 by Sandro Santilli <strk@…>, 8 months ago

In 9691b2b2/git:

Stop deprecating ST_DWithin(text) while not being deprecated

Fixes availability/changed info for ST_DWithin(..geometry..)
Add test for upgrades in presence of view using ST_DWithin(..geometry..)

References #5494 in master branch (3.5.0dev)

comment:6 by strk, 8 months ago

The problem can be verified with this:

echo 'select postgis_extensions_upgrade();' |
make check-regress RUNTESTFLAGS="--extension --upgrade --after-upgrade-script /dev/stdin -v"

comment:7 by Sandro Santilli <strk@…>, 8 months ago

In bcf92c7/git:

Allow requesting multiple upgrades to run_test.pl

Pass multiple —upgrade switches to upgrade multiple times.
It can be used to trigger bugs with still-existing functions
being marked as deprecated.

References #5494

comment:8 by Sandro Santilli <strk@…>, 8 months ago

Resolution: fixed
Status: newclosed

In d20df6a/git:

Stop deprecating ST_DWithin(text) while not being deprecated

Fixes availability/changed info for ST_DWithin(..geometry..)
Add test for upgrades in presence of view using ST_DWithin(..geometry..)

Closes #5494 in 3.4 branch (3.4.1dev)

comment:9 by strk, 8 months ago

Resolution: fixed
Status: closedreopened

Reopening as this we really want to backport to 3.1 too

comment:10 by Sandro Santilli <strk@…>, 8 months ago

In 088de39/git:

Stop deprecating ST_DWithin(text) while not being deprecated

Fixes availability/changed info for ST_DWithin(..geometry..)
Add test for upgrades in presence of view using ST_DWithin(..geometry..)

References #5494 in 3.3 branch (3.3.5dev)

comment:11 by Sandro Santilli <strk@…>, 8 months ago

In a416a44/git:

Stop deprecating ST_DWithin(text) while not being deprecated

Fixes availability/changed info for ST_DWithin(..geometry..)
Add test for upgrades in presence of view using ST_DWithin(..geometry..)

References #5494 in 3.2 branch (3.2.6dev)

comment:12 by Sandro Santilli <strk@…>, 8 months ago

Resolution: fixed
Status: reopenedclosed

In bb104ff/git:

Stop deprecating ST_DWithin(text) while not being deprecated

Fixes availability/changed info for ST_DWithin(..geometry..)
Add test for upgrades in presence of view using ST_DWithin(..geometry..)

Closes #5494 in 3.1 branch (3.1.10dev)

Note: See TracTickets for help on using tickets.