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
my @opcs = ();
my @views = ();
my @tables = ();
+my @schemas = ();
my $version = $ARGV[1];
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 = '';
}
}
+print "-- Drop all schemas.\n";
+foreach my $schema (@schemas)
+{
+ print "DROP SCHEMA $schema;\n";
+}
+
+
print "\n";
print "COMMIT;\n";