X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DB89A52A27 for ; Fri, 22 Jul 2005 02:13:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68596-10 for ; Fri, 22 Jul 2005 05:13:21 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id DBCC6529F5 for ; Fri, 22 Jul 2005 02:13:20 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j6M5DM209271; Fri, 22 Jul 2005 01:13:22 -0400 (EDT) From: Bruce Momjian Message-Id: <200507220513.j6M5DM209271@candle.pha.pa.us> Subject: Re: ROW SHARE/SELECT ... FOR UPDATE + foreign keys In-Reply-To: <7B27AD9D-67FC-47BE-9956-B4066E6B9C53@sitening.com> To: "Thomas F. O'Connell" Date: Fri, 22 Jul 2005 01:13:22 -0400 (EDT) Cc: pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/22 X-Sequence-Number: 3148 Thomas F. O'Connell wrote: > What would people think of adding a note to the ROW SHARE section of > Table-Level Locks remarking on the fact that referential integrity > checks expressed through foreign keys do SELECT ... FOR UPDATES. > > http://www.postgresql.org/docs/8.0/static/explicit- > locking.html#LOCKING-TABLES > > It was somewhat challenging today to try to track down a pervasive > locking issue related to a table not directly referenced in a stored > procedure but that was referenced by a key in a table that was being > updated. > > I'm not sure how this changes with the new shared row locking > implementation in 8.1... > 8.1 will use _shared_ row locks for such cases. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073