From: Tom Lane <tgl@sss.pgh.pa.us>
To: Keith Fiske <keith@omniti.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Dropping columns with inheritance not working as documented
Date: Tue, 02 Jun 2015 22:24:48 -0400
Message-ID: <9545.1433298288@sss.pgh.pa.us> (raw)
In-Reply-To: <CAG1_KcCK-Qa+BVk+Fh0ou4+vfWJJ-ty1u-coHgvDRuwRt=_C2Q@mail.gmail.com>
References: <CAG1_KcAmEYNRxbU5vJL3pWkXAsmtgZONZpf7F7ikXscd--TRvg@mail.gmail.com>
<7169.1433283490@sss.pgh.pa.us>
<CAG1_KcCK-Qa+BVk+Fh0ou4+vfWJJ-ty1u-coHgvDRuwRt=_C2Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Keith Fiske <keith@omniti.com> writes:
> On Tue, Jun 2, 2015 at 6:18 PM, Tom Lane <tgl@sss.pgh.pa.us> 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:
<para>
A recursive <literal>DROP COLUMN</literal> 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 <literal>DROP
COLUMN</literal> (i.e., <command>ALTER TABLE ONLY ... DROP
COLUMN</command>) never removes any descendant columns, but
instead marks them as independently defined rather than inherited.
</para>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, keith@omniti.com
Subject: Re: Dropping columns with inheritance not working as documented
In-Reply-To: <9545.1433298288@sss.pgh.pa.us>
References: <CAG1_KcAmEYNRxbU5vJL3pWkXAsmtgZONZpf7F7ikXscd--TRvg@mail.gmail.com> <7169.1433283490@sss.pgh.pa.us> <CAG1_KcCK-Qa+BVk+Fh0ou4+vfWJJ-ty1u-coHgvDRuwRt=_C2Q@mail.gmail.com> <9545.1433298288@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox