[postgis-tickets] r17321 - Make _drop_raster_constraint_spatially_unique and _raster_constraint_info_spatially_unique allow for presence or absense of schema qual on geometry cast.

Regina Obe lr at pcorp.us
Sun Mar 10 11:58:13 PDT 2019


Author: robe
Date: 2019-03-10 11:58:13 -0700 (Sun, 10 Mar 2019)
New Revision: 17321

Modified:
   branches/2.5/raster/rt_pg/rtpostgis.sql.in
   branches/2.5/raster/test/regress/check_raster_columns.sql
   branches/2.5/raster/test/regress/check_raster_columns_expected
Log:
Make _drop_raster_constraint_spatially_unique and _raster_constraint_info_spatially_unique allow for presence or absense of schema qual on geometry cast.  
Was failing before when installed as extension (but not by script)
Reference #4291 for PostGIS 2.5.2


Modified: branches/2.5/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- branches/2.5/raster/rt_pg/rtpostgis.sql.in	2019-03-10 18:51:21 UTC (rev 17320)
+++ branches/2.5/raster/rt_pg/rtpostgis.sql.in	2019-03-10 18:58:13 UTC (rev 17321)
@@ -7584,7 +7584,7 @@
 		AND s.contype = 'x'
 		AND 0::smallint = ANY (s.conkey)
 		AND idx.indexrelid = s.conindid
-		AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::@extschema at .geometry)'
+		AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::%geometry)'
 		AND s.conexclop[1] = op.oid
 		AND op.oprname = '=';
 	$$ LANGUAGE sql STABLE STRICT
@@ -7635,7 +7635,7 @@
 			AND s.contype = 'x'
 			AND 0::smallint = ANY (s.conkey)
 			AND idx.indexrelid = s.conindid
-			AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::@extschema at .geometry)'
+			AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::%geometry)'
 			AND s.conexclop[1] = op.oid
 			AND op.oprname = '=';
 
@@ -7686,7 +7686,7 @@
 		END IF;
 		fqtn := fqtn || quote_ident($2);
 
-		cn := 'enforce_coverage_tile_' || $3;
+		cn := 'enforce_coverage_tile_' || quote_ident($3);
 
 		-- metadata
 		BEGIN

Modified: branches/2.5/raster/test/regress/check_raster_columns.sql
===================================================================
--- branches/2.5/raster/test/regress/check_raster_columns.sql	2019-03-10 18:51:21 UTC (rev 17320)
+++ branches/2.5/raster/test/regress/check_raster_columns.sql	2019-03-10 18:58:13 UTC (rev 17321)
@@ -104,7 +104,7 @@
 
 SELECT AddRasterConstraints(current_schema(), 'test_raster_columns', 'rast'::name);
 SELECT AddRasterConstraints(current_schema(), 'test_raster_columns', 'rast'::name, 'regular_blocking');
-SELECT r_table_name, r_raster_column, srid, scale_x, scale_y, blocksize_x, blocksize_y, same_alignment, regular_blocking, num_bands, pixel_types, nodata_values, ST_AsEWKT(extent) FROM raster_columns WHERE r_table_name = 'test_raster_columns';
+SELECT '#1', r_table_name, r_raster_column, srid, scale_x, scale_y, blocksize_x, blocksize_y, same_alignment, regular_blocking, num_bands, pixel_types, nodata_values, ST_AsEWKT(extent) FROM raster_columns WHERE r_table_name = 'test_raster_columns';
 
 -- spatially unique, this should fail
 SELECT make_test_raster(0, 3, 3, 0, 0);
@@ -113,7 +113,7 @@
 SELECT make_test_raster(0, 3, 3, 1, 0);
 
 SELECT DropRasterConstraints(current_schema(), 'test_raster_columns', 'rast'::name, 'regular_blocking');
-SELECT r_table_name, r_raster_column, srid, scale_x, scale_y, blocksize_x, blocksize_y, same_alignment, regular_blocking, num_bands, pixel_types, nodata_values, ST_AsEWKT(extent) FROM raster_columns WHERE r_table_name = 'test_raster_columns';
+SELECT '#2', r_table_name, r_raster_column, srid, scale_x, scale_y, blocksize_x, blocksize_y, same_alignment, regular_blocking, num_bands, pixel_types, nodata_values, ST_AsEWKT(extent) FROM raster_columns WHERE r_table_name = 'test_raster_columns';
 
 -- check spatial_index
 SELECT
@@ -138,8 +138,8 @@
 -- ticket #2215
 CREATE TABLE test_raster_columns_2 AS
 	SELECT rid, rast FROM test_raster_columns;
-SELECT AddRasterConstraints(current_schema(), 'test_raster_columns_2', 'rast'::name);
-SELECT AddRasterConstraints(current_schema(), 'test_raster_columns', 'rast'::name, 'regular_blocking');
+SELECT '#2215-1', AddRasterConstraints(current_schema(), 'test_raster_columns_2', 'rast'::name);
+SELECT '#2215-2', AddRasterConstraints(current_schema(), 'test_raster_columns', 'rast'::name, 'regular_blocking');
 DROP TABLE IF EXISTS test_raster_columns_2;
 
 DROP FUNCTION make_test_raster(integer, integer, integer, double precision, double precision, double precision, double precision, double precision, double precision);

Modified: branches/2.5/raster/test/regress/check_raster_columns_expected
===================================================================
--- branches/2.5/raster/test/regress/check_raster_columns_expected	2019-03-10 18:51:21 UTC (rev 17320)
+++ branches/2.5/raster/test/regress/check_raster_columns_expected	2019-03-10 18:58:13 UTC (rev 17321)
@@ -14,10 +14,10 @@
 t
 t
 t
-test_raster_columns|rast|0|1|1|3|3|t|t|1|{8BUI}|{0}|POLYGON((0 0,0 6,6 6,6 0,0 0))
+#1|test_raster_columns|rast|0|1|1|3|3|t|t|1|{8BUI}|{0}|POLYGON((0 0,0 6,6 6,6 0,0 0))
 ERROR:  conflicting key value violates exclusion constraint "enforce_spatially_unique_test_raster_columns_rast"
 ERROR:  new row for relation "test_raster_columns" violates check constraint "enforce_coverage_tile_rast"
 t
-test_raster_columns|rast|0|1|1|3|3|t|f|1|{8BUI}|{0}|POLYGON((0 0,0 6,6 6,6 0,0 0))
-t
-t
+#2|test_raster_columns|rast|0|1|1|3|3|t|f|1|{8BUI}|{0}|POLYGON((0 0,0 6,6 6,6 0,0 0))
+#2215-1|t
+#2215-2|t



More information about the postgis-tickets mailing list