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 1gsW7D-0001Mr-9J for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Feb 2019 17:08:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsW7C-0001kM-1L for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Feb 2019 17:08:30 +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 1gsW7B-0001ib-QN for pgsql-hackers@lists.postgresql.org; Sat, 09 Feb 2019 17:08:29 +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 1gsW79-000446-Kf for pgsql-hackers@postgresql.org; Sat, 09 Feb 2019 17:08:29 +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 x19H8Kg5023860; Sat, 9 Feb 2019 12:08:20 -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: <20190209165010.GA4298@alvherre.pgsql> References: <20190209165010.GA4298@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Sat, 09 Feb 2019 13:50:10 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23858.1549732100.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 09 Feb 2019 12:08:20 -0500 Message-ID: <23859.1549732100@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: >> 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. > Yeah, it's deleting the INTERNAL dependency, because otherwise the > trigger deletion is (correctly) forbidden, since the constraint depends > on it. Well, the question that's begged here is exactly why it's okay to remove the trigger and dependency link despite the fact that the constraint needs it. I suppose the answer is that we'll subsequently insert a new trigger implementing the same constraint (and internally-linked to it)? That information is what I'd like to have in the comment. > Perhaps it'd be good to have it be more targetted: make sure it > only deletes that dependency row and not any others that the trigger > might have (though I don't have it shouldn't have any. How could it?) = I'd do > that by adding a new function I'm not sure that'd be an improvement, especially in light of the hazard that the trigger might somehow have acquired extension and/or partition dependencies that'd also cause issues. regards, tom lane