[Bucardo-general] bucardo fails to replicate when the column name contains german umlauts

Michelle Sullivan michelle at sorbs.net
Mon Sep 2 08:53:38 UTC 2013


Alex Balashov wrote:
> That's really odd.  Are Perl strings not 8-bit clean by default?  I
> wouldn't have thought...

I would suggest this is more likely to be an issue with PostgreSQL
rather than perl (though I am guessing.)

You get similar problems with using capital letters for column names...
PostgreSQL will ignore the case unless the column name is enclosed in
quotes...

CREATE TABLE testtable
(
  id integer primary key,
  host_ip inet NOT NULL,
  Prufsumme character varying(255) NOT NULL
);

INSERT INTO testtable VALUES (1, '192.168.1.1', 'foobar');

Will succeed.

INSERT INTO testtable (id, host_ip, "Prufsumme") VALUES (1,
'192.168.1.1', 'foobar');

Will also succeed.

INSERT INTO testtable (id, host_ip, Prufsumme) VALUES (1, '192.168.1.1',
'foobar');

Will fail.

INSERT INTO testtable (id, host_ip, prufsumme) VALUES (1, '192.168.1.1',
'foobar');

Will succeed on *some* versions of PostgreSQL (but should fail on all).

Michelle

>
> On 09/02/2013 04:33 AM, Christian Ritter wrote:
>
>> Hello,
>>
>> i have a really strange problem with bucardo and german umlauts.
>> If you have a table where a column name contains german umlauts bucardo
>> is unable to replicate the data.
>>
>> Bucardo version is 4.5.0 and postgres version is 9.1.9 or 9.2.1
>>
>> If you create a table like that on both databases:
>>
>> CREATE TABLE testtable
>> (
>>     id integer primary key,
>>      host_ip inet NOT NULL,
>>     prüfsumme character varying(255) NOT NULL
>> );
>>
>>
>> and then add some data to that table, like:
>>
>> INSERT INTO testtable VALUES (1, '192.168.1.1', 'foobar');
>>
>>
>> bucardo fails to replicate it and you get an error:
>>
>> KID [1/1] public.testtable INSERT source to target pk 1
>> KID Warning! Aborting due to exception for public.testtable.id: 1 Error
>> was DBD::Pg::st execute failed: ERROR:  null value in column "prüfsumme"
>> violates not-null constraint at /root/perl5/lib/perl5/Bucardo.pm line
>> 5769.
>> KID Final database backend PID is 10758
>>
>> It looks like bucardo tries to insert NULL and not foobar into the
>> column called "prüfsumme" which of course breaks the NOT NULL
>> constraint.
>>
>>
>>
>> complete log of db creation and bucardo install is here:
>> http://pastebin.com/Q8KV06jA
>>
>> log.bucardo could be found here:
>> http://pastebin.com/TyCbn8mz
>>
>> Cheers
>>
>> Christian
>> _______________________________________________
>> Bucardo-general mailing list
>> Bucardo-general at bucardo.org
>> https://mail.endcrypt.com/mailman/listinfo/bucardo-general
>
>


-- 
Michelle Sullivan
http://www.mhix.org/




More information about the Bucardo-general mailing list