[Bucardo-general] Sync of fields with user-function as default, Sync of XML fields

Franz Dürr info at fduerr.de
Thu Sep 2 16:47:28 UTC 2010

  On 02.09.2010 16:14, Greg Sabino Mullane wrote:
> On Wed, Sep 01, 2010 at 03:05:15PM +0200, Franz Dürr wrote:
>>     I encountered 2 problems:
>>     1. The user function 'client_user_id()' used for DEFAULT is seen by MCP
>>     with schema for the master db, e.g. public.client_user_id() and without
>>     schema for the remote db, e.g. public.client_user_id(), although the same
>>     schema was used to generate them.
> This is a known problem and has been fixed. Let me whip up a proper patch
> so that you can avoid this problem on 4.4.0. Okay, put into git and
> will attach to this email.
Thanks, Greg, i'll give it a try
>> 2. The attr - field crashes, as there is no equal-operator for XML.
>> This obviouly means, that you can't sync XML-fields..
> ...
>> I tried to supply an equal operator for the xml-type in schemes 'public'
>> and 'bucardo', but to no avail:
> ...
>> Does DBD ignore user defined operators or am i using the wrong schema?
>> I'm stuck at this point and would greatly appreciate any help
> As far as I know, that should work. I'd try running some sql at the
> command line to see if you can duplicate that error, then ask for
> help on #postgresql on irc.freenode.net.
I'd be quite astonished if sync of XML-fields work, as there is no 
XML-equality operator neither in Pg 8.4.4 nor in 9.0B4 and Bucardo 
doesn't provide one either
Simple test case:

create table test(id integer primary key, attr xml);
insert into test(id,attr) values (1, '<x>a</x>');
select * from test where id=1 and attr=attr;
ERROR:  operator does not exist: xml = xml
LINE 1: select * from test where id=1 and attr=attr;

With type casts it will work, of course:
select * from test where id=1 and CAST(attr AS TEXT)=CAST(attr AS TEXT);
  id |   attr
   1 | <x>a</x>
(1 Line)

More information about the Bucardo-general mailing list