Re: Can I use row-level locks to sequence READ COMMITTED transactions?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Woodcraft <mattheww(at)chiark(dot)greenend(dot)org(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can I use row-level locks to sequence READ COMMITTED transactions?
Date: 2002-07-22 20:31:07
Message-ID: 182.1027369867@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Woodcraft <mattheww(at)chiark(dot)greenend(dot)org(dot)uk> writes:
> If I use a READ COMMITTED transaction, the documentation says that a
> query in my transaction may see changes which were committed by other
> transactions after my transaction started.
> My question is, is it guaranteed that a SELECT in my transaction will
> see changes previously committed by other transactions, or is it only a
> possibility?
> By 'previously committed', I mean 'committed by a transaction which held
> a row-level lock which my transaction has since obtained'.

Yes, that will work. The SELECT sees rows that were committed at the
instant it starts, which will be after the other xact completes if you
use a FOR UPDATE lock.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-22 20:32:45 Re: Error abort transaction behaviour
Previous Message Nigel J. Andrews 2002-07-22 20:27:55 Re: URGENT! pg_dump doesn't work!