Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YzyMT-0007rn-9V for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Jun 2015 02:24:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YzyMS-0008Td-4l for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Jun 2015 02:24:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YzyMQ-0008TS-8k for pgsql-bugs@postgresql.org; Wed, 03 Jun 2015 02:24: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_SHA384:256) (Exim 4.84) (envelope-from ) id 1YzyMM-0001oH-Rz for pgsql-bugs@postgresql.org; Wed, 03 Jun 2015 02:24:53 +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 t532Om7S009546; Tue, 2 Jun 2015 22:24:48 -0400 From: Tom Lane To: Keith Fiske cc: "pgsql-bugs@postgresql.org" Subject: Re: Dropping columns with inheritance not working as documented In-reply-to: References: <7169.1433283490@sss.pgh.pa.us> Comments: In-reply-to Keith Fiske message dated "Tue, 02 Jun 2015 21:43:46 -0400" Date: Tue, 02 Jun 2015 22:24:48 -0400 Message-ID: <9545.1433298288@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Keith Fiske writes: > On Tue, Jun 2, 2015 at 6:18 PM, Tom Lane wrote: >> I think you might be misreading the docs. DROP COLUMN only propagates to >> columns that have no independent reason to exist in the child. > Honestly, this is incredibly unclear in the documentation. I have no idea > how to even edit the documentation to explain that clearly to someone > coming into this. Just doing the scenario I laid out in my example makes it > clear that this is really not intuitive at all. You can see the same > confusion from the person that reported it in the pg_partman ticket. It is documented, for example in the ALTER TABLE reference page: A recursive DROP COLUMN operation will remove a descendant table's column only if the descendant does not inherit that column from any other parents and never had an independent definition of the column. A nonrecursive DROP COLUMN (i.e., ALTER TABLE ONLY ... DROP COLUMN) never removes any descendant columns, but instead marks them as independently defined rather than inherited. I'm not sure whether it's worth going into such details in section 5.9, but certainly we could try to provide some explanation there, or wherever it was that you were looking. > Any chance on some documentation clarity? Or honestly, some further > justification for why it needs to stay like this? The killer argument, as I recall, was that we should take pains not to irretrievably drop data if there was any doubt as to whether it was still wanted. But even if you didn't believe that, there's now a dozen years worth of backwards compatibility to worry about --- it's been like this since 2002 or so. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs