[postgis-tickets] r17322 - 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 12:04:28 PDT 2019
Author: robe
Date: 2019-03-10 12:04:28 -0700 (Sun, 10 Mar 2019)
New Revision: 17322
Modified:
branches/2.4/raster/rt_pg/rtpostgis.sql.in
branches/2.4/raster/test/regress/check_raster_columns.sql
branches/2.4/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.4.7
Modified: branches/2.4/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- branches/2.4/raster/rt_pg/rtpostgis.sql.in 2019-03-10 18:58:13 UTC (rev 17321)
+++ branches/2.4/raster/rt_pg/rtpostgis.sql.in 2019-03-10 19:04:28 UTC (rev 17322)
@@ -7296,7 +7296,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
@@ -7344,7 +7344,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 = '=';
Modified: branches/2.4/raster/test/regress/check_raster_columns.sql
===================================================================
--- branches/2.4/raster/test/regress/check_raster_columns.sql 2019-03-10 18:58:13 UTC (rev 17321)
+++ branches/2.4/raster/test/regress/check_raster_columns.sql 2019-03-10 19:04:28 UTC (rev 17322)
@@ -62,7 +62,6 @@
rast := ST_MakeEmptyRaster(width, height, ul_x, ul_y, 1, 1, skew_x, skew_y, 0);
rast := ST_AddBand(rast, 1, '8BUI', initvalue, nodataval);
-
INSERT INTO test_raster_columns VALUES (rid, rast);
RETURN;
@@ -105,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);
@@ -114,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
@@ -139,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.4/raster/test/regress/check_raster_columns_expected
===================================================================
--- branches/2.4/raster/test/regress/check_raster_columns_expected 2019-03-10 18:58:13 UTC (rev 17321)
+++ branches/2.4/raster/test/regress/check_raster_columns_expected 2019-03-10 19:04:28 UTC (rev 17322)
@@ -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