Re: changing multiple pk's in one update - Mailing list pgsql-sql

From Richard Broersma
Subject Re: changing multiple pk's in one update
Date
Msg-id 396486430904131443w72ded091qe59c709c76dd0960@mail.gmail.com
Whole thread Raw
In response to Re: changing multiple pk's in one update  (Glenn Maynard <glennfmaynard@gmail.com>)
Responses Re: changing multiple pk's in one update  (Glenn Maynard <glennfmaynard@gmail.com>)
List pgsql-sql
On Mon, Apr 13, 2009 at 2:32 PM, Glenn Maynard <glennfmaynard@gmail.com> wrote:

> If your senses are reordered by someone else, and
> you operate on /10/3, you may suddenly find yourself viewing or
> modifying (or deleting!) a different sense.  This could even happen
> within the same transaction, if you're not very careful with
> locking...


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.


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug


pgsql-sql by date:

Previous
From: Glenn Maynard
Date:
Subject: Re: changing multiple pk's in one update
Next
From: Glenn Maynard
Date:
Subject: Re: changing multiple pk's in one update