Re: Transactions and insertion ordering - Mailing list pgsql-general

From James Pharaoh
Subject Re: Transactions and insertion ordering
Date
Msg-id 1086876356.2285.104.camel@localhost.localdomain
Whole thread Raw
In response to Re: Transactions and insertion ordering  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
On Thu, 2004-06-10 at 14:47, Bruno Wolff III wrote:
> I think the real problem is that the original poster needs to precisely
> define what determines order. If the precise definition is transaction
> commit order, I think that is going to be hard to do exactly right.

Yes, that is what I want. So I can guarantee that the order of the IDs
in the database will be the same as the order in which they are taken
out of the queue.

I think I've come up with a reasonable solution now though. I can lock
the record representing the queue in another table FOR UPDATE and then
do the insert, then no other process will be able to gain that lock
until I complete. Best bit is other items can still insert concurrently,
but only one per queue, which is exactly what I was after.

Thanks for the help anyway ;-)

James


pgsql-general by date:

Previous
From: Franco Bruno Borghesi
Date:
Subject: Re: Record order change after update
Next
From: Doug McNaught
Date:
Subject: Re: Record order change after update