[Bucardo-general] Why does bucardo consider non-primary keys?
Jost Boekemeier
jost.boekemeier at googlemail.com
Tue Jun 28 12:30:21 UTC 2011
The following patch should fix this:
*** Bucardo.pm 2011/06/28 11:14:53 1.1
--- Bucardo.pm 2011/06/28 12:27:21
***************
*** 3826,3832 ****
## Note: column order important for
splice and defined calls later
$SQL{delta} = qq{
! SELECT DISTINCT $drow,
BUCARDO_PK $aliaslist
FROM bucardo.bucardo_delta d
LEFT JOIN $S.$T t ON BUCARDO_JOIN
--- 3826,3832 ----
## Note: column order important for
splice and defined calls later
$SQL{delta} = qq{
! SELECT DISTINCT ON (d.rowid, BUCARDO_PK) $drow,
BUCARDO_PK $aliaslist
FROM bucardo.bucardo_delta d
LEFT JOIN $S.$T t ON BUCARDO_JOIN
***************
*** 3856,3862 ****
$clause =~ s/ AND $//;
chop $cols;
$SQL{delta} =~ s/BUCARDO_JOIN/($clause)/;
! $SQL{delta} =~ s/BUCARDO_PK/$cols/;
}
else { ## synctype eq 'pushdelta'
--- 3856,3862 ----
$clause =~ s/ AND $//;
chop $cols;
$SQL{delta} =~ s/BUCARDO_JOIN/($clause)/;
! $SQL{delta} =~ s/BUCARDO_PK/$cols/g;
}
else { ## synctype eq 'pushdelta'
***************
*** 3904,3909 ****
--- 3904,3911 ----
(my $safedbname = $targetdb) =~ s/\'/''/go;
$SQL =~ s/\$2/$safedbname/o;
$sth{source}{$g}{getdelta} = $sourcedbh->prepare($SQL);
+ $self->glog($SQL);
+
my $safesourcedb;
## Plug in for rate measuring
More information about the Bucardo-general
mailing list