From e32a89302830a5dc75ad524fab3642ce8981d4ca Mon Sep 17 00:00:00 2001 From: glynastill Date: Thu, 16 Apr 2015 13:26:37 +0100 Subject: [PATCH] Fix "--filter" logic to honour regular expressions As per the manual: "To exclude objects of a certain type by a regular expression against their name, use "noname=regex"." However the actual check in the script would only filter on an exact match; switched to regex. --- check_postgres.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index c04e98893..608f1dbdf 100644 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -7260,7 +7260,7 @@ sub schema_item_exists { for my $name (sort keys %{ $itemhash->{$db1}{$item_class} }) { ## Can exclude by 'filter' based regex - next if grep { $name eq $_ } @$exclude_regex; + next if grep { $name =~ $_ } @$exclude_regex; if (! exists $itemhash->{$db2}{$item_class}{$name}) { @@ -7336,7 +7336,7 @@ sub schema_item_differences { for my $name (sort keys %{ $itemhash->{$db1}{$item_class} }) { ## Can exclude by 'filter' based regex - next if grep { $name eq $_ } @$exclude_regex; + next if grep { $name =~ $_ } @$exclude_regex; ## This case has already been handled: next if ! exists $itemhash->{$db2}{$item_class}{$name}; -- 2.39.5