Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 13D7E9FA17A; Fri, 1 Dec 2006 14:53:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 59047-02; Fri, 1 Dec 2006 14:53:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 7D59A9F9F0E; Fri, 1 Dec 2006 14:53:02 -0400 (AST) Received: from [192.168.1.95] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id kB1Iqwwo013006 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 1 Dec 2006 10:52:59 -0800 Subject: Re: FOR SHARE vs FOR UPDATE locks From: "Joshua D. Drake" To: Tom Lane Cc: Heikki Linnakangas , Alvaro Herrera , Simon Riggs , pgsql-hackers@postgresql.org, pgsql-core@postgresql.org In-Reply-To: <1128.1164998817@sss.pgh.pa.us> References: <1144.1164924373@sss.pgh.pa.us> <1164962544.3778.847.camel@silverbirch.site> <20061201113711.GC30441@alvh.no-ip.org> <15834.1164985926@sss.pgh.pa.us> <45705E9C.2060003@enterprisedb.com> <534.1164994846@sss.pgh.pa.us> <45706A77.8030503@enterprisedb.com> <1128.1164998817@sss.pgh.pa.us> Content-Type: text/plain Organization: Command Prompt, Inc. Date: Fri, 01 Dec 2006 10:54:38 -0800 Message-Id: <1164999278.29643.46.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Fri, 01 Dec 2006 10:52:59 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/33 X-Sequence-Number: 94514 On Fri, 2006-12-01 at 13:46 -0500, Tom Lane wrote: > "Heikki Linnakangas" writes: > > Let's throw an error for now. We have to come back to this in 8.3, I think. > > After further thought I think we should also seriously consider plan C: > do nothing for now. We now realize that there have been related bugs > since 8.0, namely that > > begin; > select some rows for update; > savepoint x; > update the same rows; > rollback to x; > > leaves the tuple(s) not locked. The lack of complaints about this from > the field suggests that this isn't a huge problem in practice. If we > do make it throw an error I'm afraid that we will break applications > that aren't having a problem at the moment. > > I'm also realizing that a fix along the throw-an-error line is > nontrivial, eg, HeapTupleSatisfiesUpdate would need another return code. > > So at this point we are facing three options: > - throw in a large and poorly tested "fix" at the last moment; > - postpone 8.2 until we can think of a real fix, which might > be a major undertaking; > - ship 8.2 with the same behavior 8.0 and 8.1 had. > None of these are very attractive, but I'm starting to think the last > is the least bad. /me struggles... IMHO: option 2 is the correct option, but the least favorable. option 1 is probably bad option 3 is the lesser of the evils if we document it loudly. Joshua D. Drake > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate