Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYB9x-0006vi-1m for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Mar 2023 19:33:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pYB9v-00037z-UW for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Mar 2023 19:33:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYB9v-00037q-MT for pgsql-bugs@lists.postgresql.org; Fri, 03 Mar 2023 19:33:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pYB9t-0000UV-E9 for pgsql-bugs@lists.postgresql.org; Fri, 03 Mar 2023 19:33:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 323JXYnC2614796; Fri, 3 Mar 2023 14:33:34 -0500 From: Tom Lane To: Alvaro Herrera cc: ahodgson@simkin.ca, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17817: DISABLE TRIGGER ALL on a partitioned table with foreign key fails In-reply-to: <2553512.1677868886@sss.pgh.pa.us> References: <20230303181735.quhcvh2igowmxbs7@alvherre.pgsql> <2553512.1677868886@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 03 Mar 2023 13:41:26 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2614794.1677872014.1@sss.pgh.pa.us> Date: Fri, 03 Mar 2023 14:33:34 -0500 Message-ID: <2614795.1677872014@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Alvaro Herrera writes: >> I wonder how come this problem took so long to be detected with Ruby on >> Rails; it's been in released 13.x and 14.x for seven months now. > Um ... 13.x and 14.x aren't showing the problem, or is there something > I missed? Oh! Running the same test shows that while 12.x through 14.x do not throw an error, they don't disable the child table's triggers either. Moreover, we can't apply this fix idea since there is no tgparentid linkage (or indeed any parent trigger to link to). It's not hard to see one way to fix it: if the initial call is "for all triggers", forget about recursing for individual triggers and instead recursively do a "for all triggers" on the child. However, that would be the sort of semantics change that people tend to bitch about in stable branches, because it'd nuke non-inherited triggers too. I'm kind of inclined to leave things alone pre-v15. I asssume the existing behavior had been that way all along, or do you have reason to think it changed recently in those branches? regards, tom lane