Simplify geometry type constraint (#3070)

git-svn-id: http://svn.osgeo.org/postgis/trunk@13316 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2015-03-06 08:51:14 +00:00
parent 53f487070d
commit 54f661eeb1
2 changed files with 2 additions and 1 deletions

1
NEWS
View file

@ -62,6 +62,7 @@ PostGIS 2.2.0
* Enhancements *
- #3070, Simplify geometry type constraint
- #2839, Implement selectivity estimator for functional indexes,
speeding up spatial queries on raster tables.
(Sandro Santilli / Vizzuality)

View file

@ -2029,7 +2029,7 @@ BEGIN
BEGIN
EXECUTE 'ALTER TABLE ONLY ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || '
ADD CONSTRAINT ' || quote_ident('enforce_geotype_' || gcs.attname) || '
CHECK ((geometrytype(' || quote_ident(gcs.attname) || ') = ' || quote_literal(gtype) || ') OR (' || quote_ident(gcs.attname) || ' IS NULL))';
CHECK (geometrytype(' || quote_ident(gcs.attname) || ') = ' || quote_literal(gtype) || ')';
constraint_successful := true;
EXCEPTION
WHEN check_violation THEN