predicate locking

From: Daniel Roth <dan(dot)c(dot)roth(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: predicate locking
Date: 2005-06-12 10:39:34
Message-ID: 71038fca05061203395e5a2613@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi

Tom Lane and the postgres help state, "AFAIK, no commercial database
does predicate locking either" (12.2.2.1. Serializable Isolation
versus True Serializability)

But MSSQL (SQL Server) does predicate locking.

>From MSDN

"SERIALIZABLE

Places a range lock on the data set, preventing other users from
updating or inserting rows into the data set until the transaction is
complete. This is the most restrictive of the four isolation levels.
Because concurrency is lower, use this option only when necessary.
This option has the same effect as setting HOLDLOCK on all tables in
all SELECT statements in a transaction
"

So does MSSQL (SQL Server) implement predicate locking?

Regards,

Daniel Roth
MCSD.NET

Tom Lane wrote:
> Florian Weimer <fw(at)deneb(dot)enyo(dot)de> writes:
> > Is this a bug, or is SQLxx serializability defined in different terms?
>
> Strictly speaking, we do not guarantee serializability because we do not
> do predicate locking. See for example
> http://archives.postgresql.org/pgsql-general/2003-01/msg01581.php
>
> AFAIK, no commercial database does predicate locking either, so we all
> fall short of true serializability. The usual solution if you need the
> sort of behavior you're talking about is to take a non-sharable write
> lock on the table you want to modify, so that only one transaction can
> do the COUNT/INSERT at a time.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-06-12 15:04:02 Re: predicate locking
Previous Message Larry Meadors 2005-06-12 04:23:11 Looking for info on 8.1 features, and some examples