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 1gqRPD-00051G-Kx for pgsql-bugs@arkaria.postgresql.org; Sun, 03 Feb 2019 23:42: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 1gqRPB-0002fl-Nj for pgsql-bugs@arkaria.postgresql.org; Sun, 03 Feb 2019 23:42:29 +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 1gqRPB-0002ev-GD for pgsql-bugs@lists.postgresql.org; Sun, 03 Feb 2019 23:42: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 1gqRP5-00006g-CJ for pgsql-bugs@postgresql.org; Sun, 03 Feb 2019 23:42: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 x13NgKPI025329; Sun, 3 Feb 2019 18:42:20 -0500 From: Tom Lane To: Robins Tharakan cc: pgsql-bugs@postgresql.org Subject: Re: DROP TABLE CASCADE doesn't drop dependencies In-reply-to: References: Comments: In-reply-to Robins Tharakan message dated "Mon, 04 Feb 2019 10:22:43 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25326.1549237340.1@sss.pgh.pa.us> Date: Sun, 03 Feb 2019 18:42:20 -0500 Message-ID: <25327.1549237340@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robins Tharakan writes: > Is it expected for DROP TABLE CASCADE to find a related table but not drop > it? > The case in point, is when the base table is used as a column type. > This can at least be reproduced in v9.6 and v10, where it silently drops > the column! Dropping the column is exactly what is supposed to happen: the scope of the dependency is defined to be just the column of that type, not the table containing it. Not sure if this is documented anyplace in the SGML docs, but I'm pretty sure we have regression test cases for it. regards, tom lane