Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3764 closed defect (fixed)

PostGIS topology failures on PostgreSQL 10

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 2.4.0
Component: topology Version: master
Keywords: Cc:

Description (last modified by robe)

After I was done fixing all the raster issues with PostgreSQL 10, surprise surprise. topology has issues too.

Creating database 'postgis_reg'
Loading PostGIS into 'postgis_reg'
Loading Topology into 'postgis_reg'
PostgreSQL 10beta1 on x86_64-w64-mingw32, compiled by gcc.exe (x86_64-win32-seh-rev4, Built by MinGW-W64 project) 4.9.2, 64-bit
  Postgis 2.4.0dev - r15404 - 2017-05-26 06:16:27
  scripts 2.4.0dev r15404
  GEOS: 3.7.0dev-CAPI-1.11.0 8fe2ce6
  PROJ: Rel. 4.9.1, 04 March 2015

Running tests

 regress/legacy_validate .. ok
 regress/legacy_predicate .. ok
 regress/legacy_invalid .. ok
 regress/sqlmm .. ok
 regress/legacy_query .. ok
 regress/addnode .. ok
 regress/addedge .. ok
 regress/addface .. ok
 regress/addface2.5d .. ok
 regress/addtopogeometrycolumn .. ok
 regress/polygonize .. ok
 regress/st_addisoedge .. ok
 regress/st_addisonode .. ok
 regress/st_addedgemodface .. ok
 regress/st_addedgenewfaces .. ok
 regress/st_changeedgegeom .. ok
 regress/st_createtopogeo .. ok
 regress/st_getfacegeometry .. ok
 regress/st_getfaceedges .. ok
 regress/st_modedgeheal .. ok
 regress/st_modedgesplit .. ok
 regress/st_newedgeheal .. ok
 regress/st_newedgessplit .. ok
 regress/st_remedgenewface .. ok
 regress/st_remedgemodface .. ok
 regress/st_simplify .. failed (diff expected obtained: /projects/postgis/tmp/2.4_pg10w64/test_26_diff)
 regress/topoelement .. ok
 regress/topoelementarray_agg .. ok
 regress/topogeo_addlinestring .. ok
 regress/topogeo_addpoint .. ok
 regress/topogeo_addpolygon .. ok
 regress/topogeom_edit .. failed (diff expected obtained: /projects/postgis/tmp/2.4_pg10w64/test_32_diff)
 regress/topogeometry_type .. ok
 regress/topojson .. ok
 regress/topologysummary .. ok
 regress/topo2.5d .. ok
 regress/totopogeom .. failed (diff expected obtained: /projects/postgis/tmp/2.4_pg10w64/test_37_diff)
 regress/droptopology .. ok
 regress/droptopogeometrycolumn .. ok
 regress/copytopology .. failed (diff expected obtained: /projects/postgis/tmp/2.4_pg10w64/test_40_diff)
 regress/createtopogeom .. ok
 regress/createtopology .. ok
 regress/gml .. ok
 regress/getnodebypoint .. ok
 regress/getedgebypoint .. ok
 regress/getfacebypoint .. ok
 regress/getringedges .. ok
 regress/gettopogeomelements .. ok
 regress/layertrigger .. ok
 regress/validatetopology .. ok
 uninstall .. ok (4662)

Run tests: 51
Failed: 4

--- regress/st_simplify_expected	2016-04-27 10:57:37.693736400 -0400
+++ /projects/postgis/tmp/2.4_pg10w64/test_26_out	2017-05-26 02:22:17.991281200 -0400
@@ -1,9 +1,8 @@
 t
 L1
-N2
-S1|f|t
-S2|f|t
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
+N1
+S1|f|
+S2|f|
 L2
-HS1|f|t
-HS2|f|t
 f

--- regress/topogeom_edit_expected	2016-04-27 10:57:37.669735100 -0400
+++ /projects/postgis/tmp/2.4_pg10w64/test_32_out	2017-05-26 02:22:20.196285100 -0400
@@ -1,8 +1,5 @@
 create|t
 simple_line_layer|1
-1|start|1|10
-1|add|1|30
-1|rem|1|20
-1|dup|1|20
-1|mis|1|20
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
 Topology 'tt' dropped


--- regress/totopogeom_expected	2016-04-27 10:57:37.107702900 -0400
+++ /projects/postgis/tmp/2.4_pg10w64/test_37_out	2017-05-26 02:22:21.906287500 -0400
@@ -18,13 +18,13 @@
 ERROR:  Unsupported feature type TIN
 ERROR:  Unsupported feature type TRIANGLE
 ERROR:  Unsupported feature type CIRCULARSTRING
-POINT(0 0)|t
-LINESTRING(0 10,10 10)|t
-POLYGON((0 20,10 20,5 30,0 20),(2 22,8 22,5 28,2 22))|t
-MULTIPOINT(0 -10,5 -10)|t
-MULTILINESTRING((-1 10,-10 10),(-10 8,-2 9))|t
-MULTIPOLYGON(((100 20,110 20,105 30,100 20),(102 22,108 22,105 28,102 22)),((80 20,90 20,90 60,80 20)))|t
-GEOMETRYCOLLECTION(POINT(-100 -100),LINESTRING(-100 -90,-90 -90),POLYGON((-100 -80,-90 -80,-95 -70,-100 -80),(-98 -78,-92 -78,-95 -72,-98 -78)),MULTIPOINT(-100 -110,-95 -110),LINESTRING EMPTY,MULTILINESTRING((-101 -90,-110 -90),(-110 -92,-102 -91)),MULTIPOLYGON(((0 -80,10 -80,5 -70,0 -80),(2 -78,8 -78,5 -72,2 -78)),((-20 -80,-10 -80,-10 -40,-20 -80))))|GEOMETRYCOLLECTION(MULTIPOLYGON(((-100 -80,-95 -70,-90 -80,-100 -80),(-98 -78,-92 -78,-95 -72,-98 -78)),((0 -80,5 -70,10 -80,0 -80),(2 -78,8 -78,5 -72,2 -78)),((-20 -80,-10 -40,-10 -80,-20 -80))),MULTILINESTRING((-110 -92,-102 -91),(-101 -90,-110 -90),(-100 -90,-90 -90)),MULTIPOINT(-100 -110,-100 -100,-95 -110))
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
 MULTIPOINT EMPTY
 MULTIPOINT EMPTY
 MULTILINESTRING EMPTY
@@ -32,21 +32,19 @@
 MULTIPOLYGON EMPTY
 MULTIPOLYGON EMPTY
 GEOMETRYCOLLECTION EMPTY
-tolerance_1|0.5
-tolerance_topo_1|0.5
-tolerance_0|0
-custom_search_path|0
-#1790.1|0|0
-#1790.2|0|0
-#1790.3|0|0
-#1968.1|0
-#1968.2|0
-tgup1.1|5|100|1
-tgup1.2|5|200|2
-tgup1.3|5|200|4
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POINT) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
 #3359.setval|1|2|1
-#3359.line.1|1
-#3359.line.2|2
-#3359.area.1|1
-#3359.area.2|2
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (LINESTRING) passed to TopoGeo_AddPolygon, expected POLYGON
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
+ERROR:  Invalid geometry type (POLYGON) passed to TopoGeo_AddLinestring, expected LINESTRING
 Topology 'tt' dropped


--- regress/copytopology_expected	2016-04-27 10:57:36.714680400 -0400
+++ /projects/postgis/tmp/2.4_pg10w64/test_40_out	2017-05-26 02:22:23.096289200 -0400
@@ -19,13 +19,13 @@
 1|CITY_data_UP_down|LAYER1|
 2|CITY_data_UP_down|LAYER2|
 3|CITY_data_UP_down|LAYER3|
-node_node_id_seq|22|1|1|9223372036854775807|1|1|0|f|t
-edge_data_edge_id_seq|26|1|1|9223372036854775807|1|1|0|f|t
-face_face_id_seq|9|1|1|9223372036854775807|1|1|0|f|t
-layer_id_seq|1|1|1|9223372036854775807|1|1|f|f
-topogeo_s_1|9|1|1|9223372036854775807|1|1|0|f|t
-topogeo_s_2|8|1|1|9223372036854775807|1|1|0|f|t
-topogeo_s_3|8|1|1|9223372036854775807|1|1|0|f|t
+22|0|t
+26|0|t
+9|0|t
+ERROR:  column "sequence_name" does not exist at character 8
+9|0|t
+8|0|t
+8|0|t
 Topology 'CITY_data_UP_down' dropped
 Topology 'city_data' dropped
 #2184.1|t

Change History (14)

comment:1 by robe, 8 years ago

Description: modified (diff)

comment:2 by strk, 8 years ago

It looks like toTopoGeom function is unable to read the correct geometry type from the detoasted geometry. Is this the only failure left ? As if this is the case I'd expect much more failures around

comment:3 by robe, 8 years ago

Aside from this only failure left is the geometry one reintroduced by pramsey's commit at r15401 noted in #3759

comment:4 by robe, 8 years ago

Okay did some checking. I think topology is suffering from the same issue as what raster was. namely the CASE WHEN set returning behavior changes in PostgreSQL 10. I think I isolated the issue to the topology.totopogeom(

ageom geometry, tg topogeometry, atolerance double precision DEFAULT 0) function, there is a case statement that uses set returning function topogeo_addpolygon.

 FOR rec2 IN SELECT CASE
       WHEN rec.dims = 0 THEN
         topology.topogeo_addPoint(atopology, rec.geom, tolerance)
       WHEN rec.dims = 1 THEN
         topology.topogeo_addLineString(atopology, rec.geom, tolerance)
       WHEN rec.dims = 2 THEN
         topology.topogeo_addPolygon(atopology, rec.geom, tolerance)
       END as primitive
    LOOP

What I discovered was the SRF gets called even if the condition is not met.

I by the way did end up complaining about this because though it is sorta documented in the release notes, it seems counter intuitive in that it behaves differently with constants.

https://www.postgresql.org/message-id/000001d2d5de%24d8d66170%248a832450%24%40pcorp.us

comment:5 by robe, 8 years ago

Resolution: fixed
Status: assignedclosed

In 15406:

Fix topology PostgreSQL 10 regress errors
Change CASE WHEN SRF to use constant
Evidentally they also removed a bunch of columns from sequence table struct
I'm guessing has to do with intro of IDENTITY column type, so had to revise copytopology regress
Closes #3764

comment:6 by robe, 8 years ago

Resolution: fixed
Status: closedreopened

It sounds like they are going to disallow constants as well so I'll have to rework this using a subselect.

https://www.postgresql.org/message-id/flat/000001d2d5de%24d8d66170%248a832450%24%40pcorp.us#000001d2d5de$d8d66170$8a832450$@pcorp.us

comment:7 by robe, 8 years ago

I won't change this not yet. I'll wait for Debbie to scream about it, that way I can test the change I make to be sure it works with whatever they've come up with.

comment:8 by robe, 8 years ago

Alright guess it's time to refix this. As expected the new change to PostgreSQL 10 broke my fragile fix.

PostgreSQL 10beta1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 5.2.1-22) 5.2.1 20151010, 64-bit
  Postgis 2.4.0dev - r15433 - 2017-06-19 18:39:00
  scripts 2.4.0dev r15433
  GEOS: 3.7.0dev-CAPI-1.11.0 8fe2ce62
  PROJ: Rel. 4.9.2, 08 September 2015

Running tests

 regress/legacy_validate .. ok 
 regress/legacy_predicate .. ok 
 regress/legacy_invalid .. ok 
 regress/sqlmm .. ok 
 regress/legacy_query .. ok 
 regress/addnode .. ok 
 regress/addedge .. ok 
 regress/addface .. ok 
 regress/addface2.5d .. ok 
 regress/addtopogeometrycolumn .. ok 
 regress/polygonize .. ok 
 regress/st_addisoedge .. ok 
 regress/st_addisonode .. ok 
 regress/st_addedgemodface .. ok 
 regress/st_addedgenewfaces .. ok 
 regress/st_changeedgegeom .. ok 
 regress/st_createtopogeo .. ok 
 regress/st_getfacegeometry .. ok 
 regress/st_getfaceedges .. ok 
 regress/st_modedgeheal .. ok 
 regress/st_modedgesplit .. ok 
 regress/st_newedgeheal .. ok 
 regress/st_newedgessplit .. ok 
 regress/st_remedgenewface .. ok 
 regress/st_remedgemodface .. ok 
 regress/st_simplify .. failed (diff expected obtained: /var/lib/jenkins/workspace/postgis/tmp/2_4_pg10.0w64/test_26_diff)
-----------------------------------------------------------------------------
--- regress/st_simplify_expected	2017-02-07 07:21:40.613359496 +0000
+++ /var/lib/jenkins/workspace/postgis/tmp/2_4_pg10.0w64/test_26_out	2017-06-19 18:45:00.070826465 +0000
@@ -1,9 +1,8 @@
 t
 L1
-N2
-S1|f|t
-S2|f|t
+ERROR:  set-returning functions are not allowed in CASE at character 227
+N1
+S1|f|
+S2|f|
 L2
-HS1|f|t
-HS2|f|t
 f
-----------------------------------------------------------------------------
 regress/topoelement .. ok 
 regress/topoelementarray_agg .. ok 
 regress/topogeo_addlinestring .. ok 
 regress/topogeo_addpoint .. ok 
 regress/topogeo_addpolygon .. ok 
 regress/topogeom_edit .. failed (diff expected obtained: /var/lib/jenkins/workspace/postgis/tmp/2_4_pg10.0w64/test_32_diff)
-----------------------------------------------------------------------------
--- regress/topogeom_edit_expected	2017-02-07 07:21:40.665359497 +0000
+++ /var/lib/jenkins/workspace/postgis/tmp/2_4_pg10.0w64/test_32_out	2017-06-19 18:45:04.182826481 +0000
@@ -1,8 +1,5 @@
 create|t
 simple_line_layer|1
-1|start|1|10
-1|add|1|30
-1|rem|1|20
-1|dup|1|20
-1|mis|1|20
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
 Topology 'tt' dropped
-----------------------------------------------------------------------------
 regress/topogeometry_type .. ok 
 regress/topojson .. ok 
 regress/topologysummary .. ok 
 regress/topo2.5d .. ok 
 regress/totopogeom .. failed (diff expected obtained: /var/lib/jenkins/workspace/postgis/tmp/2_4_pg10.0w64/test_37_diff)
-----------------------------------------------------------------------------
--- regress/totopogeom_expected	2017-02-07 07:21:40.633359496 +0000
+++ /var/lib/jenkins/workspace/postgis/tmp/2_4_pg10.0w64/test_37_out	2017-06-19 18:45:07.298826492 +0000
@@ -18,13 +18,13 @@
 ERROR:  Unsupported feature type TIN
 ERROR:  Unsupported feature type TRIANGLE
 ERROR:  Unsupported feature type CIRCULARSTRING
-POINT(0 0)|t
-LINESTRING(0 10,10 10)|t
-POLYGON((0 20,10 20,5 30,0 20),(2 22,8 22,5 28,2 22))|t
-MULTIPOINT(0 -10,5 -10)|t
-MULTILINESTRING((-1 10,-10 10),(-10 8,-2 9))|t
-MULTIPOLYGON(((100 20,110 20,105 30,100 20),(102 22,108 22,105 28,102 22)),((80 20,90 20,90 60,80 20)))|t
-GEOMETRYCOLLECTION(POINT(-100 -100),LINESTRING(-100 -90,-90 -90),POLYGON((-100 -80,-90 -80,-95 -70,-100 -80),(-98 -78,-92 -78,-95 -72,-98 -78)),MULTIPOINT(-100 -110,-95 -110),LINESTRING EMPTY,MULTILINESTRING((-101 -90,-110 -90),(-110 -92,-102 -91)),MULTIPOLYGON(((0 -80,10 -80,5 -70,0 -80),(2 -78,8 -78,5 -72,2 -78)),((-20 -80,-10 -80,-10 -40,-20 -80))))|GEOMETRYCOLLECTION(MULTIPOLYGON(((-100 -80,-95 -70,-90 -80,-100 -80),(-98 -78,-92 -78,-95 -72,-98 -78)),((0 -80,5 -70,10 -80,0 -80),(2 -78,8 -78,5 -72,2 -78)),((-20 -80,-10 -40,-10 -80,-20 -80))),MULTILINESTRING((-110 -92,-102 -91),(-101 -90,-110 -90),(-100 -90,-90 -90)),MULTIPOINT(-100 -110,-100 -100,-95 -110))
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
 MULTIPOINT EMPTY
 MULTIPOINT EMPTY
 MULTILINESTRING EMPTY
@@ -32,21 +32,19 @@
 MULTIPOLYGON EMPTY
 MULTIPOLYGON EMPTY
 GEOMETRYCOLLECTION EMPTY
-tolerance_1|0.5
-tolerance_topo_1|0.5
-tolerance_0|0
-custom_search_path|0
-#1790.1|0|0
-#1790.2|0|0
-#1790.3|0|0
-#1968.1|0
-#1968.2|0
-tgup1.1|5|100|1
-tgup1.2|5|200|2
-tgup1.3|5|200|4
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
 #3359.setval|1|2|1
-#3359.line.1|1
-#3359.line.2|2
-#3359.area.1|1
-#3359.area.2|2
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
+ERROR:  set-returning functions are not allowed in CASE at character 227
 Topology 'tt' dropped
-----------------------------------------------------------------------------
 regress/droptopology .. ok 
 regress/droptopogeometrycolumn .. ok 
 regress/copytopology .. ok 
 regress/createtopogeom .. ok 
 regress/createtopology .. ok 
 regress/gml .. ok 
 regress/getnodebypoint .. ok 
 regress/getedgebypoint .. ok 
 regress/getfacebypoint .. ok 
 regress/getringedges .. ok 
 regress/gettopogeomelements .. ok 
 regress/layertrigger .. ok 
 regress/validatetopology .. ok 
 uninstall .  /var/lib/jenkins/workspace/postgis/branches/2.4/regress/00-regress-install/share/contrib/postgis/uninstall_topology.sql
  /var/lib/jenkins/workspace/postgis/branches/2.4/regress/00-regress-install/share/contrib/postgis/uninstall_postgis.sql
. ok (4662)

Run tests: 51
Failed: 3

comment:9 by robe, 8 years ago

okay this is proving to be trickier than I thought. I tried changing:

   FOR rec2 IN SELECT CASE rec.dims
       WHEN 0 THEN
         topology.topogeo_addPoint(atopology, rec.geom, tolerance)
       WHEN 1 THEN
         topology.topogeo_addLineString(atopology, rec.geom, tolerance) 
       WHEN 2 THEN
         topology.topogeo_addPolygon(atopology, rec.geom, tolerance)
       END as primitive
    LOOP

To:

   FOR rec2 IN SELECT CASE rec.dims
       WHEN 0 THEN
         (SELECT poi FROM topology.topogeo_addPoint(atopology, rec.geom, tolerance) AS poi LIMIT 1 )
       WHEN 1 THEN
         (SELECT li FROM topology.topogeo_addLineString(atopology, rec.geom, tolerance) AS li LIMIT 1)
       WHEN 2 THEN
         (SELECT poly FROM topology.topogeo_addPolygon(atopology, rec.geom, tolerance) AS poly LIMIT 1)
       END as primitive
    LOOP

and while that fixed st_simplify and topogeom_edit regress, it broke both my 9.6 and 10 in a consistent way on the totopogeom test.

I'm not sure what is the difference between the two constructs above. I would expect them to be equivalent.

 regress/legacy_validate .. ok
 regress/legacy_predicate .. ok
 regress/legacy_invalid .. ok
 regress/sqlmm .. ok
 regress/legacy_query .. ok
 regress/addnode .. ok
 regress/addedge .. ok
 regress/addface .. ok
 regress/addface2.5d .. ok
 regress/addtopogeometrycolumn .. ok
 regress/polygonize .. ok
 regress/st_addisoedge .. ok
 regress/st_addisonode .. ok
 regress/st_addedgemodface .. ok
 regress/st_addedgenewfaces .. ok
 regress/st_changeedgegeom .. ok
 regress/st_createtopogeo .. ok
 regress/st_getfacegeometry .. ok
 regress/st_getfaceedges .. ok
 regress/st_modedgeheal .. ok
 regress/st_modedgesplit .. ok
 regress/st_newedgeheal .. ok
 regress/st_newedgessplit .. ok
 regress/st_remedgenewface .. ok
 regress/st_remedgemodface .. ok
 regress/st_simplify .. ok
 regress/topoelement .. ok
 regress/topoelementarray_agg .. ok
 regress/topogeo_addlinestring .. ok
 regress/topogeo_addpoint .. ok
 regress/topogeo_addpolygon .. ok
 regress/topogeom_edit .. ok
 regress/topogeometry_type .. ok
 regress/topojson .. ok
 regress/topologysummary .. ok
 regress/topo2.5d .. ok
 regress/totopogeom .. failed (diff expected obtained: /projects/postgis/tmp/2.4_pg9.6w64/test_37_diff)
 regress/droptopology .. ok
 regress/droptopogeometrycolumn .. ok
 regress/copytopology .. ok
 regress/createtopogeom .. ok
 regress/createtopology .. ok
 regress/gml .. ok
 regress/getnodebypoint .. ok
 regress/getedgebypoint .. ok
 regress/getfacebypoint .. ok
 regress/getringedges .. ok
 regress/gettopogeomelements .. ok
 regress/layertrigger .. ok
 regress/validatetopology .. ok
 uninstall .. ok (4581)

--- regress/totopogeom_expected	2016-04-27 10:57:37.107702900 -0400
+++ /projects/postgis/tmp/2.4_pg9.6w64/test_37_out	2017-06-19 21:07:59.909850400 -0400
@@ -32,9 +32,9 @@
 MULTIPOLYGON EMPTY
 MULTIPOLYGON EMPTY
 GEOMETRYCOLLECTION EMPTY
-tolerance_1|0.5
-tolerance_topo_1|0.5
-tolerance_0|0
+tolerance_1|8.04984471899924
+tolerance_topo_1|8.04984471899924
+tolerance_0|8.04984471899924
 custom_search_path|0
 #1790.1|0|0
 #1790.2|0|0
@@ -46,7 +46,7 @@
 tgup1.3|5|200|4
 #3359.setval|1|2|1
 #3359.line.1|1
-#3359.line.2|2
+#3359.line.2|1
 #3359.area.1|1
-#3359.area.2|2
+#3359.area.2|1
 Topology 'tt' dropped

comment:10 by robe, 8 years ago

I should add I also tried removing the limit 1 clause and that made no difference.

comment:11 by strk, 8 years ago

Regina which file contains the code you're tweaking ? git grep "CASE rec.dims" returns no hits here, in svn-trunk…

comment:12 by robe, 8 years ago

Look for var_dims committed in r15406. Sorry I tried to simplify what I was saying without talking about the slight change I made a while back to work with 10 that no longer works.

Anyway I'm going to try something different. This shouldn't be in a case statement anyway since it could in theory return multiple records.

comment:13 by robe, 8 years ago

Resolution: fixed
Status: reopenedclosed

In 15438:

refix for PostgreSQL 10 changed CASE WHEN set returning behavior
Don't use CASE using UNION ALL instead with a WHERE that when resolves to false skips the output call.
Closes #3764 for PostGIS 2.4 (trunk)

comment:14 by robe, 8 years ago

In 15439:

Clean up of formatting of r15406.
Add some explanation of change from CASE to UNION ALL
change SELECT ST_Dump to FROM ST_Dump per strk's suggestion
References #3764
For more details refer to https://www.postgresql.org/message-id/000001d2d5de%24d8d66170%248a832450%24%40pcorp.us
and commit that I think introduced the original problem - https://www.postgresql.org/message-id/E1cTy4K-00085H-5v@gemulon.postgresql.org

Note: See TracTickets for help on using tickets.