From: Sandro Santilli Date: Fri, 25 Jan 2013 11:03:24 +0000 (+0000) Subject: Support dumps where the geometry column has a mixEdCaseD name X-Git-Tag: 2.1.0beta2~237 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2432756017ad912a9e0595414e69acf203853930;p=postgis Support dumps where the geometry column has a mixEdCaseD name git-svn-id: http://svn.osgeo.org/postgis/trunk@11025 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/utils/postgis_restore.pl.in b/utils/postgis_restore.pl.in index 9b55190e0..4315c126b 100755 --- a/utils/postgis_restore.pl.in +++ b/utils/postgis_restore.pl.in @@ -224,15 +224,25 @@ while( my $l = ) { # CONSTRAINT enforce_srid_the_geom CHECK ((srid(the_geom) = 2249)) # ); # + # Example 3: + # CREATE TABLE "PIANIFICAZIONE__ELEMENTO_LINEA" ( + # soft_gis_serial integer NOT NULL, + # "G" public.geometry, + # CONSTRAINT "enforce_dims_G" CHECK ((public.st_ndims("G") = 2)), + # CONSTRAINT "enforce_geotype_G" CHECK (((public.geometrytype("G") = 'MULTICURVE'::text) OR ("G" IS NULL))), + # CONSTRAINT "enforce_srid_G" CHECK ((public.st_srid("G") = (-1))) + # ); + # + # elsif ( $l =~ /CREATE TABLE *([^ ,]*)/) { my @sublines = ($l); while( my $subline = ) { - if ( $subline =~ /CONSTRAINT enforce_dims_/i ) { + if ( $subline =~ /CONSTRAINT "?enforce_dims_/i ) { $subline =~ s/\bndims\(/st_ndims(/; } - if ( $subline =~ /CONSTRAINT enforce_srid_/i ) { + if ( $subline =~ /CONSTRAINT "?enforce_srid_/i ) { $subline =~ s/\bsrid\(/st_srid(/; if ( $subline =~ /=\s\(?([-0-9][0-9]*)\)/ ) { my $oldsrid = $1;