From: Greg Sabino Mullane Date: Tue, 12 Nov 2013 17:59:27 +0000 (-0500) Subject: Fix quoting for inserts to the bucardo_deltanames table in validate_sync. X-Git-Tag: 4.99.9~2 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e531f3ff3673ad82593921f2b0c6f9b2d30d5269;p=bucardo.git Fix quoting for inserts to the bucardo_deltanames table in validate_sync. --- diff --git a/bucardo.schema b/bucardo.schema index 4ba7662b8..3b0710783 100644 --- a/bucardo.schema +++ b/bucardo.schema @@ -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);