DROP COLUMN misbehaviour with multiple inheritance - Mailing list pgsql-hackers

From Hannu Krosing
Subject DROP COLUMN misbehaviour with multiple inheritance
Date
Msg-id 1031818847.29044.6.camel@taru.tm.ee
Whole thread Raw
Responses Re: DROP COLUMN misbehaviour with multiple inheritance  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I've come upon a misbehaviour of drop column, where drop column
unconditionally drops inherited column from child tables.

What it should do is to check if the same column is not inherited from
other parents and drop it only when it is not

Here is the test case:


hannu=# create table p1(id int, name text);
CREATE TABLE
hannu=# create table p2(id2 int, name text);
CREATE TABLE
hannu=# create table c1(age int) inherits(p1,p2);
NOTICE:  CREATE TABLE: merging multiple inherited definitions of
attribute "name"
CREATE TABLE
hannu=# \d c1                               Table "public.c1"Column |  Type   | Modifiers 
--------+---------+-----------id     | integer | name   | text    | id2    | integer | age    | integer | 

hannu=# alter table p1 drop column name;
ALTER TABLE
hannu=# \d c1     Table "public.c1"Column |  Type   | Modifiers 
--------+---------+-----------id     | integer | id2    | integer | age    | integer | 


The column "c1.name" should survive the drop from p1, as it is also
inherited from p2. 

--------------------
Hannu



pgsql-hackers by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: MySQL wins award - makes amusing statement
Next
From: "Dave Page"
Date:
Subject: Re: