Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 1527F6325E2 for ; Mon, 13 Apr 2009 19:01:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 34974-07 for ; Mon, 13 Apr 2009 19:01:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.217.172]) by mail.postgresql.org (Postfix) with ESMTP id 806E46321A9 for ; Mon, 13 Apr 2009 19:01:31 -0300 (ADT) Received: by gxk20 with SMTP id 20so50012gxk.19 for ; Mon, 13 Apr 2009 15:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VbYEHFJlWljfM9jjC0F69ULFBbMYVWOADUo8TjDzbPY=; b=QP58DHR7jSQGkOQaKy63ijK7elhQLqHbv+eE4TmI5DDF/u4QThmRqq6c54CMbJfwMB 6rRe6aB5UU/4t8G1swR2VtxBRuZr4w7Nm11Di4y1VbfJ+kufHxmvZ/J9LcT94TbPAqAp CH9VdUPxFwhqRqw7G0nxRd+04CY7Mjq/vhOBQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=F3+yZ0RzRDqHOLpD58lF8esEluiA1iCtLZgmQcOouX4ApiVImlU9x+LT0z0t4xUoOE i+ECcc6spYHnsjIm3/9qK04nAie45yZxasizJDtjsqJHjSo9VPoJR4rZxTI6tqxPTk90 q/9sX+flrGMmIm+jXv6ryG2jQnUSMQadEXcJc= MIME-Version: 1.0 Received: by 10.150.144.9 with SMTP id r9mr13729924ybd.74.1239660089412; Mon, 13 Apr 2009 15:01:29 -0700 (PDT) In-Reply-To: <396486430904131443w72ded091qe59c709c76dd0960@mail.gmail.com> References: <49DC1034.1060705@frii.com> <49E37441.6030301@frii.com> <396486430904131418g3898dc5h2472f9efab331489@mail.gmail.com> <396486430904131443w72ded091qe59c709c76dd0960@mail.gmail.com> Date: Mon, 13 Apr 2009 18:01:29 -0400 Message-ID: Subject: Re: changing multiple pk's in one update From: Glenn Maynard To: Richard Broersma Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/66 X-Sequence-Number: 32412 On Mon, Apr 13, 2009 at 5:43 PM, Richard Broersma wrote: > From what I've seen, this problem can affect both surrogate and > natural key designs. =C2=A0In both cases, care must be taken to ensure th= at > an underling tuple hasn't been changed by any other clients before it > attempts to commit its changed. =C2=A0 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... --=20 Glenn Maynard