Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsN1h-0006WT-8X for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Feb 2019 07:26:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsN1e-0002ZU-FM for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Feb 2019 07:26:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsN1e-0002ZN-8C for pgsql-hackers@lists.postgresql.org; Sat, 09 Feb 2019 07:26:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsN1c-0007uz-5j for pgsql-hackers@postgresql.org; Sat, 09 Feb 2019 07:26: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 x197Q16s016447; Sat, 9 Feb 2019 02:26:01 -0500 From: Tom Lane To: Amit Langote cc: Alvaro Herrera , Peter Geoghegan , PostgreSQL Hackers Subject: Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages) In-reply-to: References: <20190208201925.GA5901@alvherre.pgsql> <29689.1549672900@sss.pgh.pa.us> Comments: In-reply-to Amit Langote message dated "Sat, 09 Feb 2019 16:14:41 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16445.1549697160.1@sss.pgh.pa.us> Date: Sat, 09 Feb 2019 02:26:00 -0500 Message-ID: <16446.1549697160@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Amit Langote writes: > On Sat, Feb 9, 2019 at 9:41 AM Tom Lane wrote: >> +1. The best solution would presumably be to go through the normal >> object deletion mechanism; though possibly there's a reason that >> won't work given you're already inside some other DDL. > Maybe: > - CatalogTupleDelete(trigrel, &trigtup->t_self); > + RemoveTriggerById(trgform->oid)? No, that's still the back end of the deletion machinery, and in particular it would fail to clean pg_depend entries for the trigger. Going in by the front door would use performDeletion(). (See deleteOneObject() to get an idea of what's being possibly missed out here.) regards, tom lane