Re: Repeatable read and serializable transactions see data committed after tx start - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Repeatable read and serializable transactions see data committed after tx start
Date
Msg-id 12606.1415254372@sss.pgh.pa.us
Whole thread Raw
In response to Re: Repeatable read and serializable transactions see data committed after tx start  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> Hmm... we do have transaction_timestamp(); perhaps we could leave that as the time BEGIN executed and shift
everythingelse to use the snapshot time.
 

It's not possible to take a timestamp that *exactly* matches the snapshot
time.   We could rearrange the code so that we ask the kernel for
timeofday just before or after capturing some relevant snapshot, but
there's still going to be some skew there.

In any case, I believe we document those timestamps as being the time of
arrival of a command from the client, not in terms of any snapshots.
To the extent that people use now() to represent the time of insertion of
data, I think the command arrival time is arguably the best definition.
Delaying it until the server code gets around to capturing a snapshot
would not be an improvement.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Convert query plan to sql query
Next
From: Andres Freund
Date:
Subject: Re: tracking commit timestamps