From ec70a564b3b4cbaa1b6bd6b810afd1bf8218a67e Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 3 Jun 2004 13:44:30 +0000 Subject: [PATCH] Made it functional again. git-svn-id: http://svn.osgeo.org/postgis/trunk@578 b70326c6-7e19-0410-871a-916f4a2858ee --- create_undef.pl | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/create_undef.pl b/create_undef.pl index 7f11d4f43..06568fffe 100644 --- a/create_undef.pl +++ b/create_undef.pl @@ -23,10 +23,10 @@ my $version = $ARGV[1]; print "BEGIN;\n"; -if ( $version eq "73" ) +if ( $version ge "73" ) { print "-- Drop index bindings from system tables\n"; - print "DROP OPERATOR CLASS gist_geometry_ops USING gist;\n"; + print "DROP OPERATOR CLASS gist_geometry_ops USING gist CASCADE;\n"; } else { @@ -43,6 +43,7 @@ while( my $line = ) { $line =~ s/[\r\n]//g; push (@funcs, $line) if ($line =~ /^create function/i); + push (@funcs, $line) if ($line =~ /^create or replace function/i); push (@ops, $line) if ($line =~ /^create operator.*\(/i); push (@aggs, $line) if ($line =~ /^create aggregate/i); push (@types, $line) if ($line =~ /^create type/i); @@ -78,7 +79,14 @@ foreach my $op (@ops) { if ($op =~ /create operator ([^(]+)/i ) { - print "DROP OPERATOR $1 (geometry,geometry);\n"; + if ( $version ge "73" ) + { + print "DROP OPERATOR $1 (geometry,geometry) CASCADE;\n"; + } + else + { + print "DROP OPERATOR $1 (geometry,geometry);\n"; + } } else { @@ -105,15 +113,15 @@ print "-- Drop all functions.\n"; foreach my $fn (@funcs) { - if ($fn =~ /create function ([^(]+)\((.*)\)/i ) + if ($fn =~ /create .* function ([^(]+)\((.*)\)/i ) { my $fn_nm = $1; my $fn_arg = $2; - if ( $version eq "73" ) + if ( $version ge "73" ) { - if ( ! ( $fn_nm =~ /_in/i || $fn_nm =~ /_out/i ) ) + if ( ! ( $fn_nm =~ /_in/i || $fn_nm =~ /_out/i || $fn_nm =~ /_recv/i || $fn_nm =~ /_send/i || $fn_nm =~ /_analyze/i ) ) { - print "DROP FUNCTION $fn_nm ($fn_arg);\n"; + print "DROP FUNCTION $fn_nm ($fn_arg) CASCADE;\n"; } } else @@ -133,7 +141,7 @@ foreach my $type (@types) { if ($type =~ /create type ([^(]+)/i ) { - if ( $version eq "73" ) + if ( $version ge "73" ) { print "DROP TYPE $1 CASCADE;\n"; } -- 2.40.0