Purge unknown tables from bucardo_delta_targets.
authorDavid E. Wheeler <david@justatheory.com>
Wed, 2 Oct 2013 16:25:39 +0000 (09:25 -0700)
committerDavid E. Wheeler <david@justatheory.com>
Wed, 2 Oct 2013 16:25:39 +0000 (09:25 -0700)
They seem to get left behind when a table is dropped. Maybe other reasons,
I honestly don't know.

bucardo.schema

index 8b30558a0f3f3bd9af4becf4b5269695ddce66cf..255675670f771295f0118fa50bf8466eda0ea3e1 100644 (file)
@@ -1537,6 +1537,11 @@ END;
             }
         }
 
+        ## Delete any tables that are no longer in the database.
+        $dbh->do(q{
+            DELETE FROM bucardo.bucardo_delta_targets
+             WHERE tablename NOT IN (select oid from pg_class)
+        });
 
         ## Create the bucardo_note_truncation function as needed
         $sth = $sth{hazfunc};