Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Date
Msg-id CA+U5nMLUDPr3Tx_oHJZnLG0YNpDx0f_E-n=dQfLSPYAFqh+TbA@mail.gmail.com
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
List pgsql-hackers
On 12 May 2012 15:55, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
>> Case (2) is more complex than described. If we use XID always, then
>> the so-say stable value could change mid way through a scan when the
>> XID is assigned and would provide neither a stable, sensible nor a
>> backwards compatible response.
>
> No, that's entirely wrong.  The original behavior of the function
> for case 2, which I am proposing we revert to,  is that it would
> forcibly assign an XID when the transaction didn't already have one.
> Subsequently, that value would be stable for the duraction of the xact.

As you said yourself, assigning an XID is exactly the same as using
ReadNewTransactionId(). There is no difference in behaviour for case
2.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Next
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value