[Bucardo-general] bucardo - bug report (multiple-field pkey)
Adam Kozłowski
tronix.ak at gmail.com
Tue Jan 11 16:41:25 UTC 2011
Hello
I have started using bucardo for multimaster replication (swap) and I
found bug related to multiple-field pkey.
Detailed situation described below.
replication type: swap
replicated table:
CREATE TABLE "public"."large_object" (
"i_id" INTEGER NOT NULL,
"blob" BYTEA,
"i_pageno" INTEGER NOT NULL,
CONSTRAINT "large_object_pkey" PRIMARY KEY("i_id", "i_pageno")
) WITH OIDS;
There are also other tables but has no affect.
Error:
KID Warning! Aborting due to exception for
public.large_object.i_id|i_pageno: 1500001227|1.
Error was DBD::Pg::st execute failed: ERROR: column "i_pageno" is of
type integer but expression is of type bytea\nLINE 1:
...lic.large_object (i_id,i_pageno, blob) VALUES ($1,$2,$3)\n
Working solution:
Index: /Bucardo/v4.4.0/ORG/Bucardo.pm
===================================================================
--- /Bucardo/v4.4.0/ORG/Bucardo.pm (revision 47)
+++ /Bucardo/v4.4.0/ORG/Bucardo.pm (revision 48)
@@ -3813,7 +3813,7 @@
for (@{$g->{binarycols}}) {
$sth{target}{$g}{insertrow}->bind_param($_ + $g->{pkcols},
undef, {pg_type => DBD::Pg::PG_BYTEA});
$sth{target}{$g}{updaterow}->bind_param($_, undef, {pg_type =>
DBD::Pg::PG_BYTEA});
- $sth{source}{$g}{insertrow}->bind_param($_+1, undef, {pg_type
=> DBD::Pg::PG_BYTEA});
+ $sth{source}{$g}{insertrow}->bind_param($_ + $g->{pkcols},
undef, {pg_type => DBD::Pg::PG_BYTEA});
$sth{source}{$g}{updaterow}->bind_param($_, undef, {pg_type =>
DBD::Pg::PG_BYTEA});
}
Please consider, does it looks reasonable ?
/Adam
More information about the Bucardo-general
mailing list