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

From Chris Angelico
Subject Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Date
Msg-id CAPTjJmorByK-vGVaL7YmcFm=gpMtqKGO5BeTQ2bzCqJyiaVfow@mail.gmail.com
Whole thread Raw
In response to Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered  ("Kevin Grittner" <kgrittn@mail.com>)
List pgsql-general
On Thu, Oct 18, 2012 at 11:26 PM, Kevin Grittner <kgrittn@mail.com> wrote:
> updating a "last_used" number in a table and
> using the result (if it is *is* critical that there are no gaps in
> the numbers).

Correct me if I'm wrong, but wouldn't:

update some_table set last_used=last_used+1 returning last_used

simply block until the other transaction is committed/rolled back?
That avoids all the issues of serialization AND retrying transactions.
Or is the delay itself a problem?

ChrisA


pgsql-general by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Next
From: "Kevin Grittner"
Date:
Subject: Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered