[Bucardo-general] Conflict Handling: Newest Data Always Wins

Greg Sabino Mullane greg at endpoint.com
Wed Oct 10 01:07:53 UTC 2007


On Tue, 2007-10-09 at 18:10 -0600, Spencer Christensen wrote:

> my ($arg) = @_;
> my $source_time = $arg->{sourcerow}->{BUCARDO_TXNTIME};
> my $target_time = $arg->{targetrow}->{BUCARDO_TXNTIME};

Sorry, Spencer, but that column is no longer there. The good news is
that there is already a fairly recent (but hidden) standard_conflict
method called 'latest' that does something similar. I'll commit an
update to make it  visible in the docs and legal in the schema. The
relevant code is at line 4135 of Bucardo.pm and it basically grabs the
times like this:

SELECT extract(epoch FROM max(txntime))
FROM bucardo.bucardo_delta
WHERE tablename=?
AND rowid=?

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation 610-983-9073

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: This is a digitally signed message part
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20071009/af65d0bb/attachment.bin 


More information about the Bucardo-general mailing list