DROP COLUMN misbehaviour with multiple inheritance

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: DROP COLUMN misbehaviour with multiple inheritance
Date: 2002-09-12 08:20:47
Message-ID: 1031818847.29044.6.camel@taru.tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2002-09-12 08:53:57 Re: 7.3beta and ecpg
Previous Message Dave Page 2002-09-12 07:32:28 Re: PGXLOG variable worthwhile?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruno Wolff III 2002-09-12 12:46:54 Re: Addition to patched README.earthdistance
Previous Message Bruce Momjian 2002-09-12 05:21:58 Re: Addition to patched README.earthdistance