Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 5E1619FA162 for ; Fri, 1 Dec 2006 08:02:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 61561-07 for ; Fri, 1 Dec 2006 08:02:13 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 168419FA12B for ; Fri, 1 Dec 2006 08:02:17 -0400 (AST) thread-index: AccVQI2Sz3+yy+AFRQKjVeN0+Z1BZA== Received: from [192.168.1.34] ([82.27.233.193]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Fri, 1 Dec 2006 07:02:19 -0500 Message-ID: <457019C4.2030906@enterprisedb.com> Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757 Date: Fri, 01 Dec 2006 12:02:12 +0000 From: "Heikki Linnakangas" User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: "Simon Riggs" , "Tom Lane" , Subject: Re: FOR SHARE vs FOR UPDATE locks References: <1144.1164924373@sss.pgh.pa.us> <1164962544.3778.847.camel@silverbirch.site> <20061201113711.GC30441@alvh.no-ip.org> In-Reply-To: <20061201113711.GC30441@alvh.no-ip.org> Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Dec 2006 12:02:19.0562 (UTC) FILETIME=[8D4618A0:01C71540] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/11 X-Sequence-Number: 94492 Alvaro Herrera wrote: > Simon Riggs wrote: > >> ISTM that multitrans could be used here. Two xids, one xmax. > > Hmm, yeah, this seems a reasonable suggestion. The problem is that we > don't have a mechanism today for saying "this Xid holds a shared lock, > this one holds an exclusive lock". So code-wise it wouldn't be simple > to do. It's a single bit per Xid, but I don't see where to store such a > thing. We could store an extra byte in front of each xid in the multixact member file. That would screw up alignment, though, unless we pad it up to int32, but that would double the space taken by the members file. Could we make the combination HEAP_XMAX_EXCL_LOCK | HEAP_XMAX_IS_MULTI legal, with the meaning that the last member in the multixact is an exclusive locker, if it's still in-progress? > I'm not sure we can use the simple "raise an ERROR" answer though, > because for users that would be a regression. Yeah, that's ugly. Though it doesn't behave correctly as it is either... -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com