From 57c4b52074e8ab7b670b9f40826318779a7407a4 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 14 Jul 2014 13:25:30 -0400 Subject: [PATCH] Fix up the backslash escaping on upgrades- should solve the recent problem of sync_name_sane violations on upgrade seen recently. --- bucardo | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bucardo b/bucardo index 8faa0c4dd..78d2f3b55 100755 --- 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"); -- 2.39.5