pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Glenn Maynard <glennfmaynard@gmail.com>
To: Richard Broersma <richard.broersma@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: changing multiple pk's in one update
Date: Mon, 13 Apr 2009 18:01:29 -0400
Message-ID: <d18085b50904131501p19d83b3cjde554953a34bb151@mail.gmail.com> (raw)
In-Reply-To: <396486430904131443w72ded091qe59c709c76dd0960@mail.gmail.com>
References: <49DC1034.1060705@frii.com>
	<dcc563d10904101120y49f00977nc74132e982518444@mail.gmail.com>
	<49E37441.6030301@frii.com>
	<d18085b50904131409g10d43d6cs35dd14ede13bc02@mail.gmail.com>
	<396486430904131418g3898dc5h2472f9efab331489@mail.gmail.com>
	<d18085b50904131432o1d3af00ci250d1077024648f5@mail.gmail.com>
	<396486430904131443w72ded091qe59c709c76dd0960@mail.gmail.com>

On Mon, Apr 13, 2009 at 5:43 PM, Richard Broersma
<richard.broersma@gmail.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



view thread (15+ messages)  latest in thread

Message-ID: <d18085b50904131501p19d83b3cjde554953a34bb151@mail.gmail.com>
Permalink:  ../d18085b50904131501p19d83b3cjde554953a34bb151@mail.gmail.com/
Also on:    postgresql.org/message-id/d18085b50904131501p19d83b3cjde554953a34bb151@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: glennfmaynard@gmail.com, richard.broersma@gmail.com
  Subject: Re: changing multiple pk's in one update
  In-Reply-To: <d18085b50904131501p19d83b3cjde554953a34bb151@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox