Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 1F91B9F9FDA for ; Fri, 1 Dec 2006 03:16:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 36053-01 for ; Fri, 1 Dec 2006 03:16:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 5215D9F9EED for ; Fri, 1 Dec 2006 03:16:36 -0400 (AST) Received: (qmail invoked by alias); 01 Dec 2006 07:16:34 -0000 Received: from 85-125-150-167.dynamic.xdsl-line.inode.at (EHLO [192.168.1.16]) [85.125.150.167] by mail.gmx.net (mp038) with SMTP; 01 Dec 2006 08:16:34 +0100 X-Authenticated: #1946847 Message-ID: <456FD6D9.9020102@gmx.at> Date: Fri, 01 Dec 2006 08:16:41 +0100 From: Michael Paesold User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Tom Lane CC: Alvaro Herrera , pgsql-hackers@postgreSQL.org Subject: Re: FOR SHARE vs FOR UPDATE locks References: <1144.1164924373@sss.pgh.pa.us> In-Reply-To: <1144.1164924373@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/2 X-Sequence-Number: 94483 Tom Lane wrote: > I'm tempted to just error out in this scenario rather than allow the > lock upgrade. Thoughts? Although this seems to be a technically hard problem, the above sentence does not sound like the PostgreSQL way to solve problems (rather like MySQL). ;-) Now seriously, isn't this a perfectly feasible scenario? E.g. the outer transaction acquires a shared lock because of foreign key constraints, and the sub transaction later wants to update that row? Best Regards Michael Paesold