Re: SELECT FOR UPDATE and LIMIT 1 behave oddly - Mailing list pgsql-bugs

From Josh Berkus
Subject Re: SELECT FOR UPDATE and LIMIT 1 behave oddly
Date
Msg-id 200411111444.08432.josh@agliodbs.com
Whole thread Raw
In response to Re: SELECT FOR UPDATE and LIMIT 1 behave oddly  (Josh Berkus <josh@agliodbs.com>)
Responses Re: SELECT FOR UPDATE and LIMIT 1 behave oddly
List 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

pgsql-bugs by date:

Previous
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1313: problems with array syntax parsing in SQL statements
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY