Question about row visibility after locks - Mailing list pgsql-hackers

From Stephan Szabo
Subject Question about row visibility after locks
Date
Msg-id 20021108093636.O12444-100000@megazone23.bigpanda.com
Whole thread Raw
Responses Re: Question about row visibility after locks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I've been wondering (and probably should look through
the code, but figured asking would be faster) if there's
any guarantee that I'll see rows inserted by a transaction
I'm waiting on in the middle of a query.

Basically, if I've got a select that's running using
HeapTupleSatisfiesDirty so that I can see uncommitted rows
and I block in the middle for another transaction (waiting
to see if it commits the row I'm looking at) and that
transaction inserts another row that meets my search criteria
am I guaranteed to see that second row in all cases?

Basically for the foreign keys, I'm doing something like the
above, but I'm worried that if the waiting for transaction
does something like:
insert ...-- At this point the select runs
delete ...
insert ...

that I won't see the last row and I'll let through an update
or delete that should have failed.




pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Domain Constraints
Next
From: "Marc G. Fournier"
Date:
Subject: Re: RC1 on Friday?