Re: determine snapshot after obtaining locks for first statement - Mailing list pgsql-hackers

From Tom Lane
Subject Re: determine snapshot after obtaining locks for first statement
Date
Msg-id 18798.1261006423@sss.pgh.pa.us
Whole thread Raw
In response to Re: determine snapshot after obtaining locks for first statement  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: determine snapshot after obtaining locks for first statement  ("Markus Wanner" <markus@bluegap.ch>)
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> (Besides which the lock acquired by UPDATE isn't exclusive and
>> wouldn't block anyway...)
> It blocks other UPDATEs.

Not at the table level.  If you could lock only at the tuple level
maybe you'd have something, but it seems like you can't find the
target tuples without having acquired a snapshot.

>> If he's talking about automatically taking an exclusive lock, I
>> doubt very many of our users would find that an improvement.
> I don't believe he's talking about a lock which excludes SELECTs on
> the data.

Well, you could take such a lock (one that blocks other UPDATEs but
not SELECTs) but it would be a clear loss of concurrency compared to
what we have now.  Unless I misunderstand what you're talking about,
it'd serialize all updates on a given table whether they conflict or
not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: PATCH: Add hstore_to_json()
Next
From: Euler Taveira de Oliveira
Date:
Subject: Re: Does "verbose" Need to be Reserved?