Re: changing multiple pk's in one update

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

On Mon, Apr 13, 2009 at 2:32 PM, Glenn Maynard <glennfmaynard(at)gmail(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Glenn Maynard 2009-04-13 22:01:29 Re: changing multiple pk's in one update
Previous Message Glenn Maynard 2009-04-13 21:32:53 Re: changing multiple pk's in one update