]> granicus.if.org Git - postgis/commitdiff
Have uninstall scripts drop created schemas, regress test it
authorSandro Santilli <strk@keybit.net>
Tue, 27 Mar 2012 18:14:39 +0000 (18:14 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 27 Mar 2012 18:14:39 +0000 (18:14 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9558 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test
utils/create_undef.pl

index 26d0684ec0553bc5dad732e0df621a3cb3f1bf30..20f714c5817588d034387424226a30be3850e571 100755 (executable)
@@ -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
index 99f311d269bdfad92a9befd79ddf4c85d694fb50..21c189b24158d253d4d50a3dd3a20e781654c869 100755 (executable)
@@ -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 = <INPUT>)
        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";