On Fri, Jul 30, 2010 at 10:23 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Robert Haas <robertmh...@gmail.com> writes: >> On Fri, Jul 30, 2010 at 10:11 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: >>> The original design idea was that coninhcount/conislocal would act >>> exactly like attinhcount/attislocal do for multiply-inherited columns. >>> Where did we fail to copy that logic? > >> We didn't. That logic is broken, too. > > Uh, full stop there. If you think that the multiply-inherited column > logic is wrong, it's you that is mistaken --- or at least you're going > to have to do a lot more than just assert that you don't like it. > We spent a *lot* of time hashing that behavior out, back around 7.3.
Well, I'm glad you spent a lot of time hashing it out, but you've got a bug. :-) Since the output in the previous email apparently wasn't sufficient for you to understand what the problem is, here it is in more detail. Initial setup: DROP SCHEMA IF EXISTS test_inheritance CASCADE; CREATE SCHEMA test_inheritance; SET search_path TO test_inheritance; CREATE TABLE level_0_parent (i int); CREATE TABLE level_0_child (a text) INHERITS (level_0_parent); CREATE TABLE level_1_parent() INHERITS (level_0_parent); CREATE TABLE level_1_child() INHERITS (level_0_child, level_1_parent); CREATE TABLE level_2_parent() INHERITS (level_1_parent); CREATE TABLE level_2_child() INHERITS (level_1_child, level_2_parent); Then: rhaas=# \d level_2_child Table "test_inheritance.level_2_child" Column | Type | Modifiers --------+---------+----------- i | integer | a | text | Inherits: level_1_child, level_2_parent rhaas=# ALTER TABLE level_0_parent ADD COLUMN a_new_column integer; NOTICE: merging definition of column "a_new_column" for child "level_1_child" NOTICE: merging definition of column "a_new_column" for child "level_2_child" NOTICE: merging definition of column "a_new_column" for child "level_2_child" ALTER TABLE rhaas=# ALTER TABLE level_0_parent DROP COLUMN a_new_column; ALTER TABLE rhaas=# \d level_2_child Table "test_inheritance.level_2_child" Column | Type | Modifiers --------------+---------+----------- i | integer | a | text | a_new_column | integer | Inherits: level_1_child, level_2_parent Adding a column to the toplevel parent of the inheritance hierarchy and then dropping it again shouldn't leave a leftover copy of the column in the grandchild. rhaas=# ALTER TABLE level_2_child DROP COLUMN a_new_column; ERROR: cannot drop inherited column "a_new_column" -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers