[postgis-tickets] [PostGIS] #3760: raster blocksize check failing on PostgreSQL 10 _raster_constraint_info_blocksize is broken

PostGIS trac at osgeo.org
Thu May 25 14:56:48 PDT 2017


#3760: raster blocksize check failing on PostgreSQL 10
_raster_constraint_info_blocksize is broken
---------------------+---------------------------
 Reporter:  robe     |      Owner:  robe
     Type:  defect   |     Status:  assigned
 Priority:  blocker  |  Milestone:  PostGIS 2.4.0
Component:  raster   |    Version:  trunk
 Keywords:           |
---------------------+---------------------------
 regarding the #3759, one of the other raster failures is that the query of
 blocksize is returning null even when the constraint is set.

 Here is an example to exercise the problem:


 {{{
 CREATE TABLE test_rast(rid serial, rast raster);

 INSERT INTO test_rast(rast)
 SELECT r
 FROM  ST_Tile(ST_MakeEmptyRaster(500, 500, 0,500, 1, 1, 0, 0, 0), 50, 50)
 AS r;

 SELECT AddRasterConstraints(current_schema(), 'test_rast', 'rast'::name,
 'blocksize');
 }}}


 In both PostgreSQL 9.6 and 10 I see the constraint for width and height
 are set as expected
 {{{
 ALTER TABLE public.test_rast
   ADD CONSTRAINT enforce_height_rast CHECK (st_height(rast) = 50);

 ALTER TABLE public.test_rast
   ADD CONSTRAINT enforce_width_rast CHECK (st_width(rast) = 50);

 }}}

 However doing a query such as:


 {{{
 SELECT _raster_constraint_info_blocksize('public', 'test_rast', 'rast',
 'width') AS width,
      _raster_constraint_info_blocksize('public', 'test_rast', 'rast',
 'width') AS height;

 }}}

 which is the function internally used by raster_columns view:

 In 10 returns nulls:


 {{{
  width | height
 -------+--------
   NULL |   NULL
 (1 row)

 }}}


 But in 9.6 and lower returns expected value:

 {{{
  width | height
 -------+--------
     50 |     50
 (1 row)
 }}}

 I'm not seeing a difference in constraint definitions between the two so
 must be something different in catalogs how this is stored

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3760>
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