Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtPa2-0004Z3-Av for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Jan 2013 21:22:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TtPa1-0007gH-Pq for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Jan 2013 21:22:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtPa0-0007fG-Ax for pgsql-hackers@postgresql.org; Thu, 10 Jan 2013 21:22:28 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtPZy-0007bi-Cy for pgsql-hackers@postgresql.org; Thu, 10 Jan 2013 21:22:27 +0000 Received: from anarazel.de (p5DDC7E60.dip.t-dialin.net [93.220.126.96]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MVrSa-1TVEtn1zVA-00XJ91; Thu, 10 Jan 2013 22:22:19 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 8AEEE1C0177; Thu, 10 Jan 2013 22:22:18 +0100 (CET) Date: Thu, 10 Jan 2013 22:22:18 +0100 From: Andres Freund To: Alvaro Herrera Cc: Erik Rijkers , Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: foreign key locks Message-ID: <20130110212218.GE4329@awork2.anarazel.de> References: <20121129152326.69330@gmx.com> <20121129160220.GA4942@alvh.no-ip.org> <20121129161654.GB4942@alvh.no-ip.org> <20121228204847.GD4150@alvh.no-ip.org> <20130110210040.GB4110@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130110210040.GB4110@alvh.no-ip.org> X-Provags-ID: V02:K0:1Y6KpL8LKtJPamZ0uHanMbLeI/KENQYz5EYbGgQDavK IgvAR9H0NPXZqi68eTbkjfzHEjmMHtDeb7dFYBumwuYcPLQ4l2 nEGgeuoayEVGMXSRgM7hxgULz43RVz99I9PZKmxOrabXmz/OQC HsRwAtttXj65f0x6VuUyEHBFg14pl2SjPzKBhjaMcgMjtejbGz OzglKRdObU8gTcQdEAopFm/c3RJg4a+G3FFoKL1oXhJp72o+9z 2bZpDs00dXyX9qNuTobSOl/CJVdK+dCWRD/R5WzKyjOEKZr85x hpgCHpd1YnAVZZXWUr4KJ4v868WzX9RLRarmWUfVyha3j7w+5d gJ73wa7cDiCXJXN2ZdtZnwWB7YhtaTcM+IdcCJL87 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2013-01-10 18:00:40 -0300, Alvaro Herrera wrote: > Here's version 28 of this patch. The only substantive change here from > v26 is that I've made GetTupleForTrigger() use either LockTupleExclusive > or LockTupleNoKeyExclusive, depending on whether the key columns are > being modified by the update. This needs to go through EvalPlanQual, so > that function is now getting the lock mode as a parameter instead of > hardcoded LockTupleExclusive. (All other users of GetTupleForTrigger > still use LockTupleExclusive, so there's no change for anybody other > than FOR EACH ROW BEFORE UPDATE triggers). Is that enough in case of a originally non-key update in read committed mode that turns into a key update due to a concurrent key update? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers