Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns
Date
Msg-id 9954.1262460756@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns  (KaiGai Kohei <kaigai@kaigai.gr.jp>)
Responses Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
KaiGai Kohei <kaigai@kaigai.gr.jp> writes:
> (2009/12/30 10:38), Robert Haas wrote:
>> No longer applies.  Can you rebase?

> The attached patch is the rebased revision.

I'm not really impressed with this patch, because it will reject
perfectly legitimate multiple-inheritance cases (ie, cases where there's
more than one inheritance path from the same parent).  This works fine
at the moment:

regression=# create table p1(f1 int, f2 int);
CREATE TABLE
regression=# create table c1(f3 int) inherits (p1);
CREATE TABLE
regression=# create table c2(f4 int) inherits (p1);
CREATE TABLE
regression=# create table cc(f5 int) inherits (c1,c2);
NOTICE:  merging multiple inherited definitions of column "f1"
NOTICE:  merging multiple inherited definitions of column "f2"
CREATE TABLE
regression=# \d cc     Table "public.cc"Column |  Type   | Modifiers 
--------+---------+-----------f1     | integer | f2     | integer | f3     | integer | f4     | integer | f5     |
integer| 
 
Inherits: c1,         c2

regression=# alter table p1 rename f2 to ff2;
ALTER TABLE
regression=# \d cc     Table "public.cc"Column |  Type   | Modifiers 
--------+---------+-----------f1     | integer | ff2    | integer | f3     | integer | f4     | integer | f5     |
integer| 
 
Inherits: c1,         c2


I don't think that protecting against cases where things won't work
is an adequate reason for breaking cases that do work.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: quoting psql varible as identifier
Next
From: Tom Lane
Date:
Subject: Re: Add subdirectory support for DATA/DOCS with PGXS