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 1gkeR2-0006Rs-SH for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Jan 2019 00:24:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkeR0-00063j-Cg for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Jan 2019 00:24:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkeR0-0005zz-1v for pgsql-hackers@lists.postgresql.org; Sat, 19 Jan 2019 00:24:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkeQx-0003dV-IH for pgsql-hackers@postgresql.org; Sat, 19 Jan 2019 00:24:24 +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 x0J0OI05016267; Fri, 18 Jan 2019 19:24:18 -0500 From: Tom Lane To: Peter Geoghegan cc: Alvaro Herrera , PostgreSQL Hackers Subject: Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages) In-reply-to: References: <20181218212053.4vqcmmcicbzr2jyc@alvherre.pgsql> <21925.1545171102@sss.pgh.pa.us> <22791.1545171984@sss.pgh.pa.us> <15190.1547757720@sss.pgh.pa.us> <24211.1547772026@sss.pgh.pa.us> <12244.1547854440@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Fri, 18 Jan 2019 16:06:58 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16265.1547857458.1@sss.pgh.pa.us> Date: Fri, 18 Jan 2019 19:24:18 -0500 Message-ID: <16266.1547857458@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > On Fri, Jan 18, 2019 at 3:34 PM Tom Lane wrote: >> Attached is a draft patch to sort objects before the recursion step >> in findDependentObjects. I found that sorting by descending OID is >> really the right thing; if we sort by increasing OID then we get a >> whole lot more diffs in the DROP CASCADE output. As shown, there >> are just a few such diffs, and many of them seem to be for the better >> anyway. > This reminds me of the output that I saw back when my patch used DESC > heap TID order. I agree that those regression test changes are > improvements. I think that they're caused by the existing nbtree > code's preference for storing duplicates on the first leaf page it > could go on that is found to be empty. Yeah, I figured the explanation for the weirder changes was somewhere around there. Like you, I haven't bothered to verify it. >> * There is still instability in which object you get told to drop >> when attempting to drop an index partition or trigger, as a consequence >> of there being two possible DEPENDENCY_INTERNAL_AUTO targets. I still >> feel that the right fix there involves changing the design for what >> dependency types we store, but I've not worked on it yet. > I thought that your ALTER OBJECT DEPENDS ON EXTENSION example made the > case for fixing that directly inarguable. I'm slightly surprised that > you're not fully convinced of this already. Have I missed some > subtlety? It's clear that we must change *something* in that area. I'm not yet wedded to a particular fix, just expressing a guess as to what might be the cleanest fix. Also, we evidently need something we can back-patch into v11, which might end up being very far from clean :-(. I have no opinions yet on what would make sense in that branch. regards, tom lane