Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Date: 2012-10-18 12:45:49
Message-ID: CAPTjJmorByK-vGVaL7YmcFm=gpMtqKGO5BeTQ2bzCqJyiaVfow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 18, 2012 at 11:26 PM, Kevin Grittner <kgrittn(at)mail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Grittner 2012-10-18 14:22:24 Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered
Previous Message Kevin Grittner 2012-10-18 12:26:32 Re: 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered