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 5531.1262539870@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Upthread you appeared to be endorsing what KaiGai has implemented here:
> http://archives.postgresql.org/pgsql-hackers/2009-11/msg00147.php

No, I said that forbidding conflicting renames would be a good solution.
I did not endorse any specific means of testing for such a conflict.
The one in this patch is not good enough to avoid breaking cases that
actually are perfectly OK.

It would be possible to detect the problematic cases correctly by first
descending the inheritance tree and counting the number of arrivals at
different children, and then doing it again and complaining if
attinhcount was different from the count obtained the first time.
This could probably be done by modifying find_all_inheritors to count
duplicate occurrences rather than just discarding them.  Whether it's
worth it is not clear.

In practice the reasonable engineering alternatives may just be to do
what KaiGai's patch does, or to do nothing.  In that case I think a good
argument can be made for the latter.  Nobody has ever complained about
this from the field AFAIR; but we might get complaints if we disable
cases that used to work fine.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: invalid UTF-8 via pl/perl
Next
From: Andrew Dunstan
Date:
Subject: Re: invalid UTF-8 via pl/perl