From 49bd61d8dd7c40f4adb1af6b0f60871ed6107983 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 12 Apr 2012 10:51:31 +0000 Subject: [PATCH] Do not assume ndims check statements are fully qualified (#1708) git-svn-id: http://svn.osgeo.org/postgis/trunk@9637 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + utils/postgis_restore.pl.in | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 74040e12c..4543fed23 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PostGIS 2.0.1 * Bug Fixes * + - #1708, improve restore of PosgreSQL 9.1 backups - #1766, don't let ST_RemEdge* destroy peripheral TopoGeometry objects. - #1714, more robust handling of high topology tolerance. - #1759, loading transformed shapefiles in raster enabled db. diff --git a/utils/postgis_restore.pl.in b/utils/postgis_restore.pl.in index e683e000d..37f72fb71 100755 --- a/utils/postgis_restore.pl.in +++ b/utils/postgis_restore.pl.in @@ -198,7 +198,7 @@ while( my $l = ) { # Rewrite spatial table constraints # - # Example: + # Example 1: # CREATE TABLE geos_in ( # id integer NOT NULL, # g public.geometry, @@ -206,6 +206,16 @@ while( my $l = ) { # CONSTRAINT enforce_geotype_g CHECK (((public.geometrytype(g) = 'MULTILINESTRING'::text) OR (g IS NULL))), # CONSTRAINT enforce_srid_g CHECK ((public.st_srid(g) = (-1))) # ); + # + # Example 2: + # CREATE TABLE boszip ( + # gid integer NOT NULL, + # zip5 character(5), + # the_geom geometry, + # CONSTRAINT enforce_dims_the_geom CHECK ((ndims(the_geom) = 2)), + # CONSTRAINT enforce_geotype_the_geom CHECK (((geometrytype(the_geom) = 'MULTIPOLYGON'::text) OR (the_geom IS NULL))), + # CONSTRAINT enforce_srid_the_geom CHECK ((srid(the_geom) = 2249)) + # ); # elsif ( $l =~ /CREATE TABLE *([^ ,]*)/) { @@ -213,7 +223,7 @@ while( my $l = ) { while( my $subline = ) { if ( $subline =~ /CONSTRAINT enforce_dims_/i ) { - $subline =~ s/\.ndims\(/.st_ndims(/; + $subline =~ s/\bndims\(/st_ndims(/; } if ( $subline =~ /CONSTRAINT enforce_srid_/i ) { $subline =~ s/\bsrid\(/st_srid(/; -- 2.40.0