From 54f661eeb1d5e72c916fdae54b26d2b5dad10ead Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 6 Mar 2015 08:51:14 +0000 Subject: [PATCH] Simplify geometry type constraint (#3070) git-svn-id: http://svn.osgeo.org/postgis/trunk@13316 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + postgis/postgis.sql.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 98802a9d5..d45467e52 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index ec84fa19a..5518c60ca 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -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 -- 2.40.0