Re: unserializable transaction? - Mailing list pgsql-general

From Tom Lane
Subject Re: unserializable transaction?
Date
Msg-id 14504.1092963835@sss.pgh.pa.us
Whole thread Raw
In response to unserializable transaction?  (s post <sbmpost@science.uva.nl>)
List pgsql-general
s post <sbmpost@science.uva.nl> writes:
> Recently I posted "notes on SERIALIZABLE transactions". In these notes I
> state that one should use SELECT FOR UPDATE on all accessed data items to
> execute SERIALIZABLE transactions. I now seem to have found a schedule
> that cannot be serialized in this way.

Congratulations, you've discovered the need for predicate locking ;-)

I'm not sure why this wasn't well-documented long ago, but I've added
something to the 8.0 docs about it:
http://developer.postgresql.org/docs/postgres/transaction-iso.html#MVCC-SERIALIZABILITY

> If so, then I suppose this is a bug?

We do not consider it a bug ... at least, doing predicate locking is not
on our list of desirable changes.  In practice, using explicit table
locking when necessary is a much more effective solution to these types
of problems.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq: passwords WAS: scripting & psql issues
Next
From: Tom Lane
Date:
Subject: Re: int8, primary key, seq scan