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

From Jim Nasby
Subject Re: Repeatable read and serializable transactions see data committed after tx start
Date
Msg-id 545AC987.2010109@BlueTreble.com
Whole thread Raw
In response to Re: Repeatable read and serializable transactions see data committed after tx start  (Álvaro Hernández Tortosa <aht@8Kdata.com>)
Responses Re: Repeatable read and serializable transactions see data committed after tx start  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Repeatable read and serializable transactions see data committed after tx start  (Álvaro Hernández Tortosa <aht@8Kdata.com>)
List pgsql-hackers
On 11/5/14, 6:04 PM, Álvaro Hernández Tortosa wrote:
>
> On 05/11/14 17:46, Jim Nasby wrote:
>> On 11/4/14, 6:11 PM, Álvaro Hernández Tortosa wrote:
>>>      Should we improve then the docs stating this more clearly? Any objection to do this?
>>
>> If we go that route we should also mention that now() will no longer be doing what you probably hope it would (AFAIK
it'sdriven by BEGIN and not the first snapshot).
 
>
>      If I understand you correctly, you mean that if we add a note to the documentation stating that the transaction
reallyfreezes when you do the first query, people would expect now() to be also frozen when the first query is done,
whichis not what happens (it's frozen at tx start). Then, yes, you're right, probably *both* the isolation levels and
thenow() function documentation should be patched to become more precise.
 

Bingo.

Hrm, is there anything else that differs between the two?

>> Perhaps we should change how now() works, but I'm worried about what that might do to existing applications...
>
>      Perhaps, I also believe it might not be good for existing applications, but it definitely has a different freeze
behavior,which seems inconsistent too.
 

Yeah, I'd really rather fix it...

Hmm... we do have transaction_timestamp(); perhaps we could leave that as the time BEGIN executed and shift everything
elseto use the snapshot time.
 

Or we could do the opposite. I suspect that would be more likely to cause data quality errors, but anyone that treats
timestampsas magic values is going to have those anyway.
 
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: recovery_target_time and standby_mode
Next
From: Peter Geoghegan
Date:
Subject: Re: B-Tree index builds, CLUSTER, and sortsupport