From 5b12e331cd67268374f5629e5568646a35b452ce Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 27 Mar 2012 18:14:39 +0000 Subject: [PATCH] Have uninstall scripts drop created schemas, regress test it git-svn-id: http://svn.osgeo.org/postgis/trunk@9558 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/run_test | 2 ++ utils/create_undef.pl | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/regress/run_test b/regress/run_test index 26d0684ec..20f714c58 100755 --- a/regress/run_test +++ b/regress/run_test @@ -588,6 +588,8 @@ count_db_objects () select count(*) from pg_aggregate union all select count(*) from pg_operator union all select count(*) from pg_opclass union all + select count(*) from pg_namespace + where nspname NOT LIKE 'pg_%' union all select count(*) from pg_opfamily ) select sum(count) from counts;" "${DB}" if [ $? -gt 0 ]; then diff --git a/utils/create_undef.pl b/utils/create_undef.pl index 99f311d26..21c189b24 100755 --- a/utils/create_undef.pl +++ b/utils/create_undef.pl @@ -42,6 +42,7 @@ my @ops = (); my @opcs = (); my @views = (); my @tables = (); +my @schemas = (); my $version = $ARGV[1]; @@ -93,6 +94,9 @@ while( my $line = ) elsif ($line =~ /^create table \s*([\w\.]+)/i) { push (@tables, $1); } + elsif ($line =~ /^create schema \s*([\w\.]+)/i) { + push (@schemas, $1); + } elsif ( $line =~ /^create operator class (\w+)/i ) { my $opcname = $1; my $am = ''; @@ -264,6 +268,13 @@ foreach my $fn (@type_funcs) } } +print "-- Drop all schemas.\n"; +foreach my $schema (@schemas) +{ + print "DROP SCHEMA $schema;\n"; +} + + print "\n"; print "COMMIT;\n"; -- 2.40.0