Better tweaking for pgservice items
authorGreg Sabino Mullane <greg@endpoint.com>
Thu, 10 Apr 2014 13:42:46 +0000 (09:42 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Thu, 10 Apr 2014 13:42:46 +0000 (09:42 -0400)
bucardo

diff --git a/bucardo b/bucardo
index bed06865050f6452216d3dcf87279308b4b75094..b865c4d7a40f7cc35d2bc9f4e5adbeb22c5a8cbb 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -1427,8 +1427,9 @@ sub add_database {
     if (exists $vals->{dbservice}) {
         delete $vals->{dbport};
         delete $vals->{dbhost};
-        $cols =~ s/dbhost,dbport,//;
-        $phs =~ s/\Q?,?,//;
+        if ($cols =~ s/dbhost,dbport,//) {
+            $phs =~ s/\Q?,?,//;
+        }
     }
 
     ## Attempt to insert this into the database