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 1pjlKn-00011s-MC for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Apr 2023 18:24:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjlKl-00081V-Ns for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Apr 2023 18:24:43 +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 1pjlKl-00081M-Fc for pgsql-bugs@lists.postgresql.org; Tue, 04 Apr 2023 18:24:43 +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 1pjlKe-0002br-T4 for pgsql-bugs@lists.postgresql.org; Tue, 04 Apr 2023 18:24:42 +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 334IOWq31582615; Tue, 4 Apr 2023 14:24:32 -0400 From: Tom Lane To: jazz001319@gmail.com cc: Alvaro Herrera , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17886: Error disabling user triggers on a partitioned table In-reply-to: <17886-5406d5d828aa4aa3@postgresql.org> References: <17886-5406d5d828aa4aa3@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 04 Apr 2023 16:47:33 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1582613.1680632672.1@sss.pgh.pa.us> Date: Tue, 04 Apr 2023 14:24:32 -0400 Message-ID: <1582614.1680632672@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > result: > postgres=# alter table public.test DISABLE TRIGGER USER; > ERROR: 42704: trigger "trigger_test" for table "test_def" does not exist > LOCATION: EnableDisableTriggerNew, trigger.c:1658 > Expected Result (Postgresql 15.2 and 14.4 - fine): > testdb=> alter table public.test DISABLE TRIGGER USER; > ALTER TABLE Commit ec0925c22 seems to have been quite snakebit. I already fixed a deficiency in it in v15/HEAD, but here we have a different symptom in the older branches. What's happening is that EnableDisableTrigger is ignoring the child trigger because it has tgisinternal set to true and the command passes skip_system = true. I'm inclined to think that in the older branches (pre f4566345c) we need to do - if (oldtrig->tgisinternal) + if (oldtrig->tgisinternal && !OidIsValid(oldtrig->tgparentid)) { /* system trigger ... ok to process? */ but I've not tested that. Alvaro, what do you think? regards, tom lane