Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D492BB5DBDC for ; Tue, 19 Jul 2011 18:30:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 57131-08 for ; Tue, 19 Jul 2011 21:30:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 9F7D9B5DBD8 for ; Tue, 19 Jul 2011 18:30:48 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p6JLUlfu005770; Tue, 19 Jul 2011 17:30:48 -0400 (EDT) To: "Kevin Grittner" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6123: DELETE fails if before trigger causes another trigger to UPDATE In-reply-to: <201107191831.p6JIVdxu055846@wwwmaster.postgresql.org> References: <201107191831.p6JIVdxu055846@wwwmaster.postgresql.org> Comments: In-reply-to "Kevin Grittner" message dated "Tue, 19 Jul 2011 18:31:39 +0000" Date: Tue, 19 Jul 2011 17:30:47 -0400 Message-ID: <5769.1311111047@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.035 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.135 X-Spam-Level: X-Archive-Number: 201107/140 X-Sequence-Number: 30752 "Kevin Grittner" writes: > [ circular trigger relationships ] > I expect the DELETE from a to delete related b record(s) and then succeed. > Instead the UPDATE in b_del_trig causes delete of a to silently fail. The update causes the already-selected target row version of the DELETE to be obsoleted, so heap_delete finds it has nothing to do. I'm disinclined to mess with that logic. regards, tom lane