Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3PqA-0003yL-Jd for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Apr 2017 16:30:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d3PqA-0001PW-67 for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Apr 2017 16:30:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3PpS-0007LQ-AB for pgsql-bugs@postgresql.org; Wed, 26 Apr 2017 16:30:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3PpP-0006vX-VA for pgsql-bugs@postgresql.org; Wed, 26 Apr 2017 16:30:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v3QGU2BV006537; Wed, 26 Apr 2017 12:30:02 -0400 From: Tom Lane To: Martin cc: pgsql-bugs@postgresql.org Subject: Re: Re: AfterTriggerSaveEvent() Error on altered foreign key cascaded delete In-reply-to: <1493223536261-5958509.post@n3.nabble.com> References: <24945.1477510973@sss.pgh.pa.us> <1493223536261-5958509.post@n3.nabble.com> Comments: In-reply-to Martin message dated "Wed, 26 Apr 2017 09:18:56 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6535.1493224202.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Apr 2017 12:30:02 -0400 Message-ID: <6536.1493224202@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Martin writes: > I am facing the exact same bug when using circular references: I see no error when I try this example in HEAD. I think possibly you are hitting a bug we fixed last year: Author: Tom Lane Branch: master [a522fc3d8] 2016-10-26 17:05:06 -0400 Branch: REL9_6_STABLE Release: REL9_6_2 [445035a6e] 2016-10-26 17:05:06 -04= 00 Branch: REL9_5_STABLE Release: REL9_5_6 [b53c841e5] 2016-10-26 17:05:06 -04= 00 Branch: REL9_4_STABLE Release: REL9_4_11 [3a9a8c408] 2016-10-26 17:05:06 -0= 400 Fix incorrect trigger-property updating in ALTER CONSTRAINT. =20=20=20=20 The code to change the deferrability properties of a foreign-key constr= aint updated all the associated triggers to match; but a moment's examinatio= n of the code that creates those triggers in the first place shows that only some of them should track the constraint's deferrability properties. T= his leads to odd failures in subsequent exercise of the foreign key, as the triggers are fired at the wrong times. Fix that, and add a regression = test comparing the trigger properties produced by ALTER CONSTRAINT with those you get by creating the constraint as-intended to begin with. =20=20=20=20 Per report from James Parks. Back-patch to 9.4 where this ALTER functionality was introduced. =20=20=20=20 Report: If you're not running a current minor release, please update. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs