summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2011-10-06 19:04:01 +0000
committerGreg Sabino Mullane2011-10-06 19:04:01 +0000
commit98f74f2f8ee4e06a937ab0443aca1ab63885990c (patch)
tree29c33a9bb1e215441cd8b910e29ad7291cfaec9a
parent674fefa997d4ef8dfe1b064034fdf3d5b6961d45 (diff)
Use the full path when getting sequence information for same_schema.
Thanks to Cindy Wise for the bug report.
-rwxr-xr-xcheck_postgres.pl3
-rw-r--r--t/02_same_schema.t16
2 files changed, 12 insertions, 7 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index ccf62a072..a0a4f6589 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -730,7 +730,8 @@ WHERE t.typtype NOT IN ('b','c')},
sequence => {
SQL => q{
SELECT c.*, nspname||'.'||relname AS name, quote_ident(usename) AS owner,
- quote_ident(relname) AS safename, quote_ident(nspname) AS schema
+ (quote_ident(nspname)||'.'||quote_ident(relname)) AS safename,
+quote_ident(nspname) AS schema
FROM pg_class c
JOIN pg_user u ON (u.usesysid = c.relowner)
JOIN pg_namespace n ON (n.oid = c.relnamespace)
diff --git a/t/02_same_schema.t b/t/02_same_schema.t
index 848cce1e0..3a205c79e 100644
--- a/t/02_same_schema.t
+++ b/t/02_same_schema.t
@@ -325,20 +325,24 @@ SEQUENCE:
$t = qq{$S reports on sequence differences};
like ($cp1->run($connect3), qr{^$label OK}, $t);
+$dbh1->do('CREATE SCHEMA wakko');
+$dbh2->do('CREATE SCHEMA wakko');
+$dbh3->do('CREATE SCHEMA wakko');
+
$t = qq{$S reports sequence on 1 but not 2};
-$dbh1->do(q{CREATE SEQUENCE yakko});
+$dbh1->do(q{CREATE SEQUENCE wakko.yakko});
like ($cp1->run($connect2),
qr{^$label CRITICAL.*Items not matched: 1 .*
-Sequence "public.yakko" does not exist on all databases:
+Sequence "wakko.yakko" does not exist on all databases:
\s*Exists on: 1
\s*Missing on: 2\s*$}s,
$t);
$t = qq{$S reports sequence differences};
-$dbh2->do(q{CREATE SEQUENCE yakko MINVALUE 10 MAXVALUE 100 INCREMENT BY 3});
+$dbh2->do(q{CREATE SEQUENCE wakko.yakko MINVALUE 10 MAXVALUE 100 INCREMENT BY 3});
like ($cp1->run($connect2),
qr{^$label CRITICAL.*Items not matched: 1 .*
-\s*Sequence "public.yakko":
+\s*Sequence "wakko.yakko":
\s*"increment_by" is different:
\s*Database 1: 1
\s*Database 2: 3
@@ -359,8 +363,8 @@ like ($cp1->run($connect2),
$t = qq{$S does not report sequence differences if the 'nosequence' filter is given};
like ($cp1->run("$connect3 --filter=nosequence"), qr{^$label OK}, $t);
-$dbh1->do(q{DROP SEQUENCE yakko});
-$dbh2->do(q{DROP SEQUENCE yakko});
+$dbh1->do(q{DROP SEQUENCE wakko.yakko});
+$dbh2->do(q{DROP SEQUENCE wakko.yakko});
$t = qq{$S reports on sequence differences};
like ($cp1->run($connect3), qr{^$label OK}, $t);