Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 62D289FA162 for ; Fri, 1 Dec 2006 07:37:22 -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 53539-10 for ; Fri, 1 Dec 2006 07:37:13 -0400 (AST) 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 96EAA9FA173 for ; Fri, 1 Dec 2006 07:37:17 -0400 (AST) Received: from alvh.no-ip.org (200-126-100-202.bk7-dsl.surnet.cl [200.126.100.202]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id kB1BbDaL031897; Fri, 1 Dec 2006 03:37:13 -0800 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 4A25EC2D33D; Fri, 1 Dec 2006 08:37:11 -0300 (CLST) Date: Fri, 1 Dec 2006 08:37:11 -0300 From: Alvaro Herrera To: Simon Riggs Cc: Tom Lane , pgsql-hackers@postgreSQL.org Subject: Re: FOR SHARE vs FOR UPDATE locks Message-ID: <20061201113711.GC30441@alvh.no-ip.org> Mail-Followup-To: Simon Riggs , Tom Lane , pgsql-hackers@postgreSQL.org References: <1144.1164924373@sss.pgh.pa.us> <1164962544.3778.847.camel@silverbirch.site> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1164962544.3778.847.camel@silverbirch.site> User-Agent: Mutt/1.5.13 (2006-08-11) 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 03:37:14 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/10 X-Sequence-Number: 94491 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. I'm not sure we can use the simple "raise an ERROR" answer though, because for users that would be a regression. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support