Re: SELECT FOR UPDATE

From: Mike Castle <dalgoda(at)ix(dot)netcom(dot)com>
To: Postgres <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT FOR UPDATE
Date: 2001-08-23 15:11:29
Message-ID: 20010823081129.B9288@thune.mrc-home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 23, 2001 at 10:09:19AM -0400, Jan Wieck wrote:
> Oliver Elphick wrote:
> > I can see arguments to support this view, but consider this classic
> > scenario:
> >
> > User1: Read data into an interactive program
> > User1: Start to make changes
> > User2: Read data into an interactive program
> > User2: Start to make changes
> > User1: Save changes
> > User2: Save changes

Consider replacing "Save changes" with:

User1: Lock record, compare original with current record, save if same, unlock
User2: Lock record, compare original with current record, notice difference, abort.

So, yes, 3 buffers: One for original record, one for modified record, one
to hold record for comparison (during lock).

mrc
--
Mike Castle dalgoda(at)ix(dot)netcom(dot)com www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Schapachnik 2001-08-23 15:16:36 Views in PgAccess
Previous Message Mike Finn 2001-08-23 15:08:39 Re: Comparing fixed precision to floating (no anwer)