[postgis-tickets] r14372 - _raster_constraint_info_scale gives invalid input syntax, NEWS update

Regina Obe lr at pcorp.us
Sat Nov 7 02:24:12 PST 2015


Author: robe
Date: 2015-11-07 02:24:12 -0800 (Sat, 07 Nov 2015)
New Revision: 14372

Modified:
   branches/2.2/NEWS
   branches/2.2/raster/rt_pg/rtpostgis.sql.in
Log:
_raster_constraint_info_scale gives invalid input syntax, NEWS update

closes #3360 fix for PostGIS 2.2 
NEWS update also references #3355

Modified: branches/2.2/NEWS
===================================================================
--- branches/2.2/NEWS	2015-11-07 10:10:17 UTC (rev 14371)
+++ branches/2.2/NEWS	2015-11-07 10:24:12 UTC (rev 14372)
@@ -1,5 +1,5 @@
 PostGIS 2.2.1
-2015/10/XX
+2015/11/XX
 
  * Bug Fixes *
 
@@ -9,6 +9,8 @@
   - #3329, Fix robustness regression in TopoGeo_addPoint
   - #3321, Fix performance regression in topology loading
   - Fix memory leak in lwt_ChangeEdgeGeom [liblwgeom]
+  - #3355 geography ST_Segmentize has geometry bbox 
+  - #3360, _raster_constraint_info_scale invalid input syntax
 
 
 PostGIS 2.2.0

Modified: branches/2.2/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- branches/2.2/raster/rt_pg/rtpostgis.sql.in	2015-11-07 10:10:17 UTC (rev 14371)
+++ branches/2.2/raster/rt_pg/rtpostgis.sql.in	2015-11-07 10:24:12 UTC (rev 14372)
@@ -6947,7 +6947,7 @@
 
 CREATE OR REPLACE FUNCTION _raster_constraint_info_scale(rastschema name, rasttable name, rastcolumn name, axis char)
 	RETURNS double precision AS $$
-	SELECT
+	WITH c AS (SELECT
 		regexp_replace(
 			replace(
 				split_part(
@@ -6957,7 +6957,7 @@
 				'round(', ''
 			),
 			'[ ''''\(\)]', '', 'g'
-		)::double precision
+		)::text AS val
 	FROM pg_class c, pg_namespace n, pg_attribute a, pg_constraint s
 	WHERE n.nspname = $1
 		AND c.relname = $2
@@ -6966,7 +6966,12 @@
 		AND s.connamespace = n.oid
 		AND s.conrelid = c.oid
 		AND a.attnum = ANY (s.conkey)
-		AND s.consrc LIKE '%st_scale' || $4 || '(% = %';
+		AND s.consrc LIKE '%st_scale' || $4 || '(% = %') 
+-- if it is a comma separated list of two numbers then need to use round
+   SELECT CASE WHEN split_part(c.val,',', 2) > '' 
+        THEN round( split_part(c.val, ',',1)::numeric, split_part(c.val,',',2)::integer )::float8 
+        ELSE c.val::float8 END
+        FROM c;
 	$$ LANGUAGE sql STABLE STRICT
   COST 100;
 



More information about the postgis-tickets mailing list