Opened 11 years ago
Closed 11 years ago
#2708 closed patch (fixed)
updategeometrysrid doesn't update srid check in some cases
Reported by: | igorberman | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.4 |
Component: | postgis | Version: | 2.1.x |
Keywords: | history | Cc: |
Description ¶
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
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 (…)"
Change History (4)
comment:1 by , 11 years ago
Milestone: | → PostGIS 2.1.3 |
---|---|
Owner: | changed from | to
comment:2 by , 11 years ago
comment:3 by , 11 years ago
Type: | defect → patch |
---|
Marc,
Thanks I'll try to take a look at this later today.
comment:4 by , 11 years ago
Keywords: | history added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Hi everybody,
I took a stab at this: https://github.com/postgis/postgis/pull/26
I think the original bug is a result of using
schema_name
(the raw passed argument) instead of the verified variablereal_schema
.This is the diff