[Bucardo-general] Swap with Multi Column primary key

Kaveh Mousavi Zamani kavehmz at gmail.com
Tue Mar 30 09:34:16 UTC 2010


I am using Bucardo 4.5.0.

I am trying to setup a swap replication for a table that has a primary key
that is consisted of three columns,

create table b (n1 text, n2 text, n3 text,n4 text, primary key (n1,n2,n3));

When I see the log it always say:
KID Warning! Aborting due to exception for public.b.n1|n2|n3: e|a|a Error
was DBD::Pg::st execute failed: called with 1 bind variables when 4 are
needed at /usr/local/share/perl/5.10.0/Bucardo.pm line 5925.

As I traced the problem, when I change

5845:   my $tgtpks = $g->{pkcols} <= 1 ? [$pkval] :
to use $info1 instead of $info2, like this:
5845:   my $tgtpks = $g->{pkcols} <= 1 ? [$pkval] :

everything goes well. As I check $info2 is never filled properly.

There problem was raising from (In eval):

if ($g->{does_target_makedelta}) {
    if ($sync->{does_target_makedelta_triggers}{$targetdb}) {
        $targetdbh->do(q{SET session_replication_role = 'origin'});
    if ($action & 1 or $action & 8) {
    if ($sync->{does_target_makedelta_triggers}{$targetdb}) {
        $targetdbh->do(q{SET session_replication_role = 'replica'});

I think the new changes wont work properly just for table with multi column
primary key. For single it is perfect.

does anyone understand it properly to fix it better?

Best Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20100330/bd229b3d/attachment.html 

More information about the Bucardo-general mailing list