[Bucardo-general] Design of new txntime field

Greg Sabino Mullane greg at endpoint.com
Thu Sep 7 19:50:11 UTC 2017

On Thu, Sep 07, 2017 at 12:00:37PM -0400, Ioana Danes wrote:
> ... I changed the code by adding a bigint txnid in addition to ‎the txntime and 
> I am using it for everything except conflict resolution where I am still using 
> the txntime. I have it running on 9 production sites for the past 1-2 years and 
> the performance is great.

Excellent, glad to hear that solution is working for you. I've done some more testing,  
and it looks like the new way will be changing the txntime column from timestamp 
to text, and the default changed to now()::timestamp || txid_current()::text.
Some big wins from this choice:

* Still allows conflict resolution, as it's just basically a timestamp with some 
added numbers
* Guaranteed unique as the txnid acts like a global sequence
* Same value for the same transaction
* Still human-readable
* Very easy to upgrade existing installations - the timestamp and timestamp+txid 
can coexist peacefully

Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 2529 DF6A B8F7 9407 E944  45B4 BC9B 9067 1496 4AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20170907/2787570c/attachment.sig>

More information about the Bucardo-general mailing list