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