Re: Atomic/locked "allocation" of table row?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sten Daniel Soersdal <netslists(at)gmail(dot)com>
Cc: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Atomic/locked "allocation" of table row?
Date: 2007-08-06 15:19:23
Message-ID: 27701.1186413563@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Sten Daniel Soersdal <netslists(at)gmail(dot)com> writes:
> According to the manual it says that this would sometimes fail when
> "serializable" isolation cannot be obtained, is there any way to make it
> wait for it? Or do i have to wrap the transaction with an exception clause?

If you don't want it to fail on conflicts, don't use SERIALIZABLE.
Instead, use SELECT FOR UPDATE followed by UPDATE within a transaction.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-08-06 15:36:01 Re: doubt about datum
Previous Message Luca Ferrari 2007-08-06 14:57:29 Re: doubt about datum