Peter Eisentraut <peter_e@gmx.net> writes:
> On mån, 2012-01-16 at 22:59 -0300, Alvaro Herrera wrote:
>> So who's going to work on a patch? Peter, are you? If not, we should
>> add it to the TODO list.
> Not at this very moment, but maybe in a few weeks.
BTW, it strikes me that maybe the coding should work about like this:
if (!TransactionIdIsValid(age_reference_xid)){ age_reference_xid = GetTopTransactionIdIfAny(); if
(!TransactionIdIsValid(age_reference_xid)) age_reference_xid = ReadNewTransactionId();}... use age_reference_xid
tocompute result ...
and of course code somewhere to reset age_reference_xid at end of xact.
The advantage of this is
(1) same code works on master and standby
(2) calling age() no longer requires an otherwise read-only transaction
to acquire an XID.
regards, tom lane