Re: SELECT FOR UPDATE and LIMIT 1 behave oddly

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Andrea Suisani <sickpig(at)opinioni(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: SELECT FOR UPDATE and LIMIT 1 behave oddly
Date: 2004-11-11 22:44:08
Message-ID: 200411111444.08432.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrea,

> i'm sorry for the curiosity.... but
> could you share, if it's possible, this workaround? ;)
> (if it's not the one you describe at the beginning thread
> e.g. don't use LIMIT 1)

Well, we actually roped in the pg_locks view to do a "SELECT the first row not
already locked for update". Then added some code on the client end for
error handling, like race conditions and no rows being returned, both of
which happen in production.

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-11-11 22:53:08 Re: BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY
Previous Message PostgreSQL Bugs List 2004-11-11 22:43:58 BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY