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 1gr8tk-00044k-3B for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Feb 2019 22:08:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gr8ti-0003Hi-La for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Feb 2019 22:08:54 +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 1gr8ti-0003Ha-EF for pgsql-hackers@lists.postgresql.org; Tue, 05 Feb 2019 22:08:54 +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 1gr8tg-0004Ta-E3 for pgsql-hackers@postgresql.org; Tue, 05 Feb 2019 22:08:54 +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 x15M8mQc004573; Tue, 5 Feb 2019 17:08:48 -0500 From: Tom Lane To: Alvaro Herrera cc: Peter Geoghegan , PostgreSQL Hackers Subject: Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages) In-reply-to: <20190205212829.GA20127@alvherre.pgsql> References: <20190205212829.GA20127@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 05 Feb 2019 18:28:29 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4571.1549404528.1@sss.pgh.pa.us> Date: Tue, 05 Feb 2019 17:08:48 -0500 Message-ID: <4572.1549404528@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-Jan-29, Tom Lane wrote: >> It strikes me however that we can stick with the existing catalog contents >> by making this definition: of the INTERNAL_AUTO dependencies of a given >> object, the "true owner" to be reported in errors is the dependency >> that is of the same classId as that object. If this doesn't uniquely >> identify one dependency, the report will mention a random one. This is >> ugly as well, but it's certainly a lot more practical to cram into v11, >> and it seems like it would cover the current and likely future use-cases >> for partition-related objects. When and if we find a use-case for which >> this doesn't work, we can think about extending the catalog representation >> to identify a unique owner in a less ad-hoc way. > This seems a great idea. Do you want me to implement it? 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. regards, tom lane