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 1gsVDP-0006wG-7O for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Feb 2019 16:10:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsVDM-0000U1-8V for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Feb 2019 16:10:48 +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 1gsVDM-0000Se-1P for pgsql-hackers@lists.postgresql.org; Sat, 09 Feb 2019 16:10:48 +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 1gsVDI-0002Yh-RV for pgsql-hackers@postgresql.org; Sat, 09 Feb 2019 16:10:47 +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 x19GAcFP005944; Sat, 9 Feb 2019 11:10:38 -0500 From: Tom Lane To: Alvaro Herrera cc: Amit Langote , Peter Geoghegan , PostgreSQL Hackers Subject: Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages) In-reply-to: <20190209155613.GA2091@alvherre.pgsql> References: <20190209155613.GA2091@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Sat, 09 Feb 2019 12:56:13 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5942.1549728638.1@sss.pgh.pa.us> Date: Sat, 09 Feb 2019 11:10:38 -0500 Message-ID: <5943.1549728638@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-Feb-09, Tom Lane wrote: >> 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.) > This patch I think does the right thing. (squint ...) Don't much like the undocumented deleteDependencyRecordsFor call; that looks like it's redundant with what deleteOneObject will do. I think you're doing it to get rid of the INTERNAL dependency so that deletion won't recurse across that, but why is that a good idea? Needs a comment at least. Also, I suspect you might need a second CCI after the performDeletion call, in case the loop iterates? regards, tom lane