Re: Question about RI checks - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Question about RI checks
Date
Msg-id CA+TgmoYHO=r62KMS5TwJLkOJm-JbOvV6gEA99BWxLpdDkrWqKA@mail.gmail.com
Whole thread Raw
In response to Re: Question about RI checks  (Florian Pflug <fgp@phlo.org>)
Responses Re: Question about RI checks
List pgsql-hackers
On Fri, Oct 24, 2014 at 2:12 PM, Florian Pflug <fgp@phlo.org> wrote:
>> What about doing one scan using SnapshotAny and then testing each
>> returned row for visibility under both relevant snapshots?  See
>> whether there is any tuple for which they disagree.
>
> See my other mail - testing whether the snapshots agree isn't enough,
> you'd have to check whether there could have been *any* snapshot taken
> between the two which would see a different result.

Oh, hmm.  I had thought what I was proposing was strong enough to
handle that case, but now I see that it isn't.  However, I'm not
entirely sure that it's the RI code's job to prevent such cases, or at
least not when the transaction isolation level is less than
serializable.  Is there an argument that the anomaly that results is
unacceptable at REPEATABLE READ?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: How ugly would this be? (ALTER DATABASE)
Next
From: Pavel Stehule
Date:
Subject: Re: Function array_agg(array)