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 1grDmR-0000Oe-3v for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Feb 2019 03:21:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1grDmP-00024g-Qz for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Feb 2019 03:21:41 +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 1grDmP-00024Z-Gf for pgsql-hackers@lists.postgresql.org; Wed, 06 Feb 2019 03:21:41 +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 1grDmN-0006eW-0j for pgsql-hackers@postgresql.org; Wed, 06 Feb 2019 03:21:40 +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 x163LZmC020445; Tue, 5 Feb 2019 22:21:35 -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: <20190205212829.GA20127@alvherre.pgsql> <4572.1549404528@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Tue, 05 Feb 2019 14:50:34 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20443.1549423295.1@sss.pgh.pa.us> Date: Tue, 05 Feb 2019 22:21:35 -0500 Message-ID: <20444.1549423295@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > On Tue, Feb 5, 2019 at 2:08 PM Tom Lane wrote: >> I've got much of the code for it already (in the wreckage of my failed >> attempts), so I'll go back and finish that up. I was just waiting to see >> how loudly people would howl about using object type as a condition for >> figuring out what a pg_depend entry really means. If we're okay with >> that hack, I think I can make it work. > Perhaps I've missed some subtlety, but I'm not sure that it's all that > ugly. If splitting INTERNAL_AUTO into two new dependency types amounts > to the same thing as what you suggest here, then what's the > difference? It's the same as long as we always think that the "real owner" of a subsidiary object is of the same type as that object, eg that the real owner of a per-partition trigger is the parent trigger, the real owner of a per-partition index is the parent index, etc ... and that there's only going to be one parent object of that type. I don't immediately have a counterexample to this, which is why I feel like this is an OK solution for now. But I'm not sure it'll hold good indefinitely. Actually, the index case is already on the edge of being a problem: both parents will be relations, and I suspect the code will have to look at relkinds to identify which parent to consider the "real owner". BTW, does anyone else feel like our terminology around partitions is a dead loss? I have not seen anybody use the word in a way that makes a clear distinction between the parent "partitioned" object and the child "partition" objects, at least not when it comes to subsidiary objects like triggers. regards, tom lane