Re: Tracking row updates - race condition

From: Harald Fuchs <use_reply_to(at)protecting(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Tracking row updates - race condition
Date: 2005-03-29 11:23:46
Message-ID: pur7hyr8zh.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <4248E1AE(dot)8090404(at)alexandcarmen(dot)com>,
Alex Adriaanse <alex(at)alexandcarmen(dot)com> writes:

> Thanks for the input everyone. I think Harald's approach will work
> well...

I'm not so sure anymore :-(

Consider something like that:

UPDATE tbl SET col1 = 1 WHERE col2 = 1;
UPDATE tbl SET col1 = 2 WHERE col2 = 1;

with not much time inbetween. By using NULL temporarily, you destroy
the ordering. The client won't miss an UPDATE, but it might execute
the second one before the first. Neither my nor your idea appear to
take care of that.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message DanishLuxury@gmx.net 2005-03-29 12:02:45 unsubscribe
Previous Message Sim Zacks 2005-03-29 10:04:14 Re: plpython function problem workaround