Comparing txid and xmin (under BDR) - Mailing list pgsql-general

From Peter Mogensen
Subject Comparing txid and xmin (under BDR)
Date
Msg-id 5550AA2C.4010308@one.com
Whole thread Raw
Responses Re: Comparing txid and xmin (under BDR)  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-general
Hi,

I would really like to be able to externally to Postgres at some point
in time later, be able to compare the txid of 2 queries.

Namely:
The INSERT transaction for a certain row in a table,  and
The SELECT transaction reading some other data.

With the one caveat that this has to work with BDR.

So ... I can easily get the current txid of the SELECT transaction by
calling txid_current().

However, - I can't in general compare it to the xmin of the table row.
BDR does ensure (it seems) that xmin is meaningfull within the local
node xid context.

But after a xid wrap-around all txids will be larger than any xmin. And
I can't get the epoch of the xmin value.

BUT ... will this work: ?

Comparing
txid_current() of the SELECT transaction,
to
txid-current()-age(xmin) of the table row?


/Peter



pgsql-general by date:

Previous
From: Steve Clark
Date:
Subject: Re: noobie join question
Next
From: Raymond O'Donnell
Date:
Subject: Re: Restarting DB after moving to another drive