[postgis-tickets] [PostGIS] #4530: upgrade postgis 2.3 to postgis 3.0.0rc1 fails at raster
PostGIS
trac at osgeo.org
Sun Oct 13 02:13:31 PDT 2019
#4530: upgrade postgis 2.3 to postgis 3.0.0rc1 fails at raster
------------------------------------+---------------------------
Reporter: robe | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.0.1
Component: build/upgrade/install | Version: trunk
Resolution: | Keywords:
------------------------------------+---------------------------
Comment (by strk):
I think it's a legit failure. The code at hand is
raster/rt_pg/rtpostgis.sql.in around line 7490.
Function _add_raster_constraint_extent(rastschema name, rasttable name,
rastcolumn name).
The offending "null argument to EXECUTE" comes from here:
sql := 'SELECT @extschema at .st_ashexewkb( @extschema at .st_setsrid(
@extschema at .st_extent( @extschema at .st_envelope('
|| quote_ident($3)
|| ')), ' || srid || ')) FROM '
|| fqtn;
EXECUTE sql INTO attr;
I bet {{{ srid }}} is the null value, propagating to the whole {{{ sql
}}}. Here's how it is fetched:
sql := 'SELECT @extschema at .ST_SRID('
|| quote_ident($3)
|| ') FROM '
|| fqtn
|| ' WHERE '
|| quote_ident($3)
|| ' IS NOT NULL LIMIT 1;';
EXECUTE sql INTO srid;
Now.. what if the raster table is empty ? I guess SRID remains NULL,
making a NULL sql and getting to the error. I'd rather fix than comment
out.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4530#comment:3>
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