Re: choosing the right locking mode

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Craig Ringer" <craig(at)postnewspapers(dot)com(dot)au>
Cc: rihad <rihad(at)mail(dot)ru>, pgsql-general(at)postgresql(dot)org
Subject: Re: choosing the right locking mode
Date: 2008-04-03 17:59:10
Message-ID: dcc563d10804031059v5caa91f1rf3aaad046600b929@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 3, 2008 at 11:45 AM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au> wrote:
> rihad wrote:
> > Given this type query:
> >
> > UPDATE bw_pool
> > SET user_id=?
> > WHERE bw_id=
> > (SELECT MIN(bw_id) FROM bw_pool WHERE user_id IS NULL)
> > RETURNING bw_id
>
> Can you use a SERIALIZABLE transaction and avoid the explicit lock?

I'm pretty sure serializable won't fix this.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rihad 2008-04-03 18:00:56 Re: deadlock
Previous Message Sam Mason 2008-04-03 17:54:45 Re: choosing the right locking mode