Re: changing multiple pk's in one update

From: Glenn Maynard <glennfmaynard(at)gmail(dot)com>
To: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: changing multiple pk's in one update
Date: 2009-04-13 22:01:29
Message-ID: d18085b50904131501p19d83b3cjde554953a34bb151@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Apr 13, 2009 at 5:43 PM, Richard Broersma
<richard(dot)broersma(at)gmail(dot)com> wrote:
> From what I've seen, this problem can affect both surrogate and
> natural key designs.  In both cases, care must be taken to ensure that
> an underling tuple hasn't been changed by any other clients before it
> attempts to commit its changed.   Probably the most common solution is
> to use optimistic locking, another solution that I know of is to use
> serialized transaction isolation.

Right, but if you have a delayed UI, you probably don't want to hold a
lock open--if the user is viewing "/100/3" and clicks "delete", you
need to make sure that the one you delete is the same /100/3 that the
user was viewing at the time. That's harder to do...

--
Glenn Maynard

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stuart McGraw 2009-04-14 02:27:00 Re: changing multiple pk's in one update
Previous Message Richard Broersma 2009-04-13 21:43:01 Re: changing multiple pk's in one update