summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2009-08-27 16:14:05 +0000
committerGreg Sabino Mullane2009-08-27 16:14:05 +0000
commit70fbbc7097f8254cc0ae0bbae3d96c226b89c07f (patch)
tree4c896ea7bfb6a4ce78b356f8fe7598b1861e1fcc /check_postgres.pl
parent53efadf95287efe1ba74a92ebd2aba35f38dcd81 (diff)
Allow broader stroke exclusion with --exclude in same_schema.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl45
1 files changed, 45 insertions, 0 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index a7a116011..67afd2af7 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -4921,6 +4921,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next TABLE if $name =~ /$exclude/;
+ }
+
push @{$fail{tables}{notexist}{1}} => $name;
$failcount++;
}
@@ -4935,6 +4939,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next TABLE if $name =~ /$exclude/;
+ }
+
if (! exists $thing{1}{tables}{$name}) {
## If the schema does not exist, don't bother reporting it
if (exists $thing{1}{schemas}{ $thing{2}{tables}{$name}{schema} }) {
@@ -5044,6 +5052,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next VIEW if $name =~ /$exclude/;
+ }
+
push @{$fail{views}{notexist}{1}} => $name;
$failcount++;
}
@@ -5058,6 +5070,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next VIEW if $name =~ /$exclude/;
+ }
+
if (! exists $thing{1}{views}{$name}) {
## If the schema does not exist, don't bother reporting it
if (exists $thing{1}{schemas}{ $thing{2}{views}{$name}{schema} }) {
@@ -5142,10 +5158,15 @@ SQL
## Compare columns
## Any columns on 1 but not 2, or 2 but not 1?
+ COLUMN:
for my $name (sort keys %{$thing{1}{columns}}) {
## Skip any mismatched tables - already handled above
next if ! exists $thing{2}{columns}{$name};
+ for my $exclude (@{$opt{exclude}}) {
+ next COLUMN if $name =~ /$exclude/;
+ }
+
my ($t1,$t2) = ($thing{1}{columns}{$name},$thing{2}{columns}{$name});
for my $col (sort keys %$t1) {
if (! exists $t2->{$col}) {
@@ -5196,6 +5217,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next CONSTRAINT if $name =~ /$exclude/;
+ }
+
push @{$fail{constraints}{notexist}{1}} => [$name, $thing{1}{constraints}{$name}];
$failcount++;
}
@@ -5210,6 +5235,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next CONSTRAINT if $name =~ /$exclude/;
+ }
+
if (! exists $thing{1}{constraints}{$name}) {
## If the table does not exist, we don't report it
@@ -5246,6 +5275,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next CONSTRAINT if $name =~ /$exclude/;
+ }
+
push @{$fail{colconstraints}{notexist}{1}} => [$name, $tname, $cname];
$failcount++;
}
@@ -5260,6 +5293,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next CONSTRAINT if $name =~ /$exclude/;
+ }
+
if (! exists $thing{1}{colconstraints}{$name}) {
## If the table does not exist, we don't report it
@@ -5333,6 +5370,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next FUNCTION if $name =~ /$exclude/;
+ }
+
## Skip if these are a side effect of having a language
for my $l (@{$fail{language}{notexist}{1}}) {
$l =~ s/u$//;
@@ -5355,6 +5396,10 @@ SQL
}
}
+ for my $exclude (@{$opt{exclude}}) {
+ next FUNCTION if $name =~ /$exclude/;
+ }
+
## Skip if these are a side effect of having a language
for my $l (@{$fail{language}{notexist}{2}}) {
$l =~ s/u$//;