Opened 14 months ago
Closed 14 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 , 14 months ago
comment:2 by , 14 months ago
Milestone: | PostGIS 3.4.1 → PostGIS 3.1.10 |
---|---|
Version: | 3.4.x → master |
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 , 14 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 , 14 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:6 by , 14 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:9 by , 14 months ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Reopening as this we really want to backport to 3.1 too
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 #5035Specifically 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.