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

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Date: 2012-05-12 16:31:14
Message-ID: CA+U5nMLUDPr3Tx_oHJZnLG0YNpDx0f_E-n=dQfLSPYAFqh+TbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 12 May 2012 15:55, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-05-12 16:59:07 Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Previous Message Tom Lane 2012-05-12 14:55:12 Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-05-12 16:59:07 Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Previous Message Tom Lane 2012-05-12 14:55:12 Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value