[postgis-tickets] [PostGIS] #2708: updategeometrysrid doesn't update srid check in some cases

PostGIS trac at osgeo.org
Tue Apr 8 09:07:07 PDT 2014


#2708: updategeometrysrid doesn't update srid check in some cases
------------------------+---------------------------------------------------
 Reporter:  igorberman  |       Owner:  pramsey
     Type:  defect      |      Status:  new    
 Priority:  medium      |   Milestone:         
Component:  postgis     |     Version:  2.1.x  
 Keywords:              |  
------------------------+---------------------------------------------------
 Hi,
 after upgrading to 9.3, and to postgis2.1 as extention(full version
 details at the bottom)
 I've noticed behaviour that updategeometrysrid doesn't update constraint
 if schema isn't specified

 steps to reproduce:
 1.
 CREATE TABLE test
 (
   geom_utm geometry,
   CONSTRAINT enforce_srid_geom_utm CHECK (st_srid(geom_utm) = 0)
 )

 when I try to update srid to something <> 0,
 without schema parameter
 2.
 select updategeometrysrid('test','geom_utm', 32630);
 it doesn't change the check definition, instead it inserts the check in
 column definition:
 \d test
 CREATE TABLE test
 (
   geom_utm geometry(Geometry,32630),
   CONSTRAINT enforce_srid_geom_utm CHECK (st_srid(geom_utm) = 0)
 )
 while
 3.
 select updategeometrysrid('public', 'test','geom_utm', 32630);
 does updates the constraint
 \d test
 CREATE TABLE test
 (
   geom_utm geometry,
   CONSTRAINT enforce_srid_geom_utm CHECK (st_srid(geom_utm) = 32630)
 )

 in both cases geometry_columns view is updated to have new srid and
 in both cases I get "public.test.geom_utm SRID changed to 32630" message

 my default schema is 'public'(verified by 'select current_schema')


 version details:
 "PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc
 (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1, 64-bit POSTGIS="2.1.2 r12389"
 GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL
 1.9.0, released 2011/12/29" LIBXML="2.9.1" LIBJSON="U (...)"

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