Fix quoting for inserts to the bucardo_deltanames table in validate_sync.
authorGreg Sabino Mullane <greg@endpoint.com>
Tue, 12 Nov 2013 17:59:27 +0000 (12:59 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Tue, 12 Nov 2013 17:59:27 +0000 (12:59 -0500)
bucardo.schema

index 4ba7662b8c19939dd950f459a0315850b0a35d25..3b07107832fae998844919fa6ae2a4c92a00440e 100644 (file)
@@ -2036,6 +2036,7 @@ SELECT 'Fixme'::TEXT;
 
     for my $schema (sort keys %goat) {
         for my $table (sort keys %{$goat{$schema}}) {
+
             ## Map to the actual table name used, via the customname table
             my ($remoteschema,$remotetable) = ($schema,$table);
 
@@ -2063,7 +2064,7 @@ SELECT 'Fixme'::TEXT;
             $SQL .= '(nspname = ? AND relname = ?) OR ';
             push @args => $remoteschema, $remotetable;
             if ($goat{$schema}{$table}{reltype} eq 'table') {
-                push @args2 => $syncname, "$remoteschema.$remotetable";
+                push @args2 => $syncname, $remoteschema, $remotetable;
             }
 
         } ## end each table
@@ -2085,8 +2086,8 @@ SELECT 'Fixme'::TEXT;
         $sth = $dbh->prepare($SQL);
         $sth->execute($syncname);
         $SQL = $SQL2;
-        my $number = @args2 / 2;
-        $SQL .= '(?,?),' x $number;
+        my $number = @args2 / 3;
+        $SQL .= q{(?,quote_ident(?)||'.'||quote_ident(?)),} x $number;
         chop $SQL;
         $sth = $dbh->prepare($SQL);
         $sth->execute(@args2);