The query returns true if the new table is present, not if the old one
is present.
.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;