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 1gkHXe-00070i-7h for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jan 2019 23:57:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkHXc-0006HR-GN for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jan 2019 23:57:44 +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 1gkHXc-0006HK-5j for pgsql-hackers@lists.postgresql.org; Thu, 17 Jan 2019 23:57:44 +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 1gkHXZ-0004UF-RB for pgsql-hackers@postgresql.org; Thu, 17 Jan 2019 23:57:42 +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 x0HNvaw9020600; Thu, 17 Jan 2019 18:57:36 -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: <19220.1547767251@sss.pgh.pa.us> References: <201901172247.uqvtve6ekpvh@alvherre.pgsql> <19220.1547767251@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 17 Jan 2019 18:20:51 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20598.1547769456.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 17 Jan 2019 18:57:36 -0500 Message-ID: <20599.1547769456@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Also, I am suspicious that this implementation fails on point 3 > anyway ... If nothing else, it looks like ALTER OBJECT DEPENDS ON > EXTENSION can be used to attach a random dependency to just > about anything. Yup: regression=3D# drop table if exists idxpart cascade; DROP TABLE regression=3D# create table idxpart (a int) partition by range (a); CREATE TABLE regression=3D# create index on idxpart (a); CREATE INDEX regression=3D# create table idxpart1 partition of idxpart for values from = (0) to (10); CREATE TABLE regression=3D# drop index idxpart1_a_idx; -- no way ERROR: cannot drop index idxpart1_a_idx because index idxpart_a_idx requi= res it HINT: You can drop index idxpart_a_idx instead. regression=3D# \d idxpart1 Table "public.idxpart1" Column | Type | Collation | Nullable | Default = --------+---------+-----------+----------+--------- a | integer | | | = Partition of: idxpart FOR VALUES FROM (0) TO (10) Indexes: "idxpart1_a_idx" btree (a) regression=3D# create extension cube; CREATE EXTENSION regression=3D# alter index idxpart1_a_idx depends on extension cube; ALTER INDEX regression=3D# drop extension cube; DROP EXTENSION regression=3D# \d idxpart1 Table "public.idxpart1" Column | Type | Collation | Nullable | Default = --------+---------+-----------+----------+--------- a | integer | | | = Partition of: idxpart FOR VALUES FROM (0) TO (10) regards, tom lane