Comparing txid and xmin (under BDR)

From: Peter Mogensen <apm(at)one(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Comparing txid and xmin (under BDR)
Date: 2015-05-11 13:10:04
Message-ID: 5550AA2C.4010308@one.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2015-05-11 13:18:41 Re: Restarting DB after moving to another drive
Previous Message Steve Clark 2015-05-11 13:06:43 Re: noobie join question