Fix up the backslash escaping on upgrades- should solve the recent problem of sync_na...
authorGreg Sabino Mullane <greg@endpoint.com>
Mon, 14 Jul 2014 17:25:30 +0000 (13:25 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Mon, 14 Jul 2014 17:25:30 +0000 (13:25 -0400)
bucardo

diff --git a/bucardo b/bucardo
index 8faa0c4ddc22d7d6d5595226dabcc31254811c91..78d2f3b550d9d7c67cf62b5f1d49c2acb49627b7 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -7956,16 +7956,14 @@ sub upgrade {
             next;
         }
 
-##CHECK ((isolation_level IS NULL) OR (lower(isolation_level) = ANY (ARRAY['serializable', 'repeatable read']))) vs CHECK (isolation_level IS NULL OR (LOWER(isolation_level) IN ('serializable', 'repeatable read')))
-
         ## Clean up the constraint to make it match what comes back from the database:
         $cdef =~ s/;$//;
         $cdef =~ s/','/', '/g;
-        $cdef =~ s{\\\\}{\\}g;
         if ($cdef =~ s/([^)]) (OR|AND) (\w)/$1) $2 ($3/g) {
             $cdef =~ s/CHECK (.+)/CHECK ($1)/;
         }
         my $condef = constraint_definition($cname);
+        $condef =~ s{\\}{\\\\}g;
         if ($condef ne $cdef) {
             upgrade_and_log("ALTER TABLE $tcname DROP CONSTRAINT $cname");
             upgrade_and_log("ALTER TABLE $tcname ADD CONSTRAINT $cname $cdef");