Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered - Mailing list pgsql-general

From Craig Ringer
Subject Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Date
Msg-id 507F80C4.2020903@ringerc.id.au
Whole thread Raw
In response to Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Responses Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered  (Chris Angelico <rosuav@gmail.com>)
List pgsql-general
On 10/17/2012 04:16 PM, Albe Laurenz wrote:
> Why? They can be serialized. The outcome would be exactly the same
> if session 2 completed before session 1 began.

Hmm. Good point; so long as *either* ordering is valid it's fine, it's
only when *both* orderings are invalid that a serialization failure
would occur. For some reason I had myself thinking that if a conflict
could occur in either ordering the tx would fail, which wouldn't really
be desirable and isn't how it works.

BTW, the issue with the underlying question is that their "name" column
is unique. They expected to get a serialization failure on duplicate
insert into "name", not a unique constraint violation. The question
wasn't "why doesn't this fail" but "Why does this fail with a different
error than I expected". Not that the question made that particularly clear.

--
Craig Ringer


pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: database corruption questions
Next
From: Chris Angelico
Date:
Subject: Re: Improve MMO Game Performance