No, really properly check for the old bucarodo_sequences table.
authorDavid E. Wheeler <david@justatheory.com>
Fri, 2 Nov 2012 16:47:14 +0000 (09:47 -0700)
committerDavid E. Wheeler <david@justatheory.com>
Fri, 2 Nov 2012 16:47:14 +0000 (09:47 -0700)
The query returns true if the new table is present, not if the old one
is present.

bucardo.schema

index 7ad5809c703fec92a0e5087d70f4419251c6e63a..b329c72266e8a877a22a73398f1535ce0eda42c9 100644 (file)
@@ -1893,7 +1893,7 @@ SELECT 'Fixme'::TEXT;
                       .q{ AND attrelid = (SELECT c.oid FROM pg_class c, pg_namespace n }
                       .q{ WHERE n.oid = c.relnamespace AND n.nspname = 'bucardo' }
                       .q{ AND c.relname = 'bucardo_sequences')};
-                if ($dbh->selectall_arrayref($SQL)->[0][0]) {
+                if ($dbh->selectall_arrayref($SQL)->[0][0] < 1) {
                     warn "Dropping older version of bucardo_sequences, then recreating empty\n";
                     $dbh->do('DROP TABLE bucardo.bucardo_sequences');
                     $count = 0;