Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org, Thom Brown <thombrown(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns
Date: 2010-02-02 02:55:17
Message-ID: 4B679415.9080900@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2010/02/02 11:44), Robert Haas wrote:
> 2010/2/1 KaiGai Kohei<kaigai(at)ak(dot)jp(dot)nec(dot)com>:
>> (2010/02/02 11:31), Robert Haas wrote:
>>> 2010/2/1 KaiGai Kohei<kaigai(at)ak(dot)jp(dot)nec(dot)com>:
>>>> (2010/02/02 11:09), Tom Lane wrote:
>>>>> KaiGai Kohei<kaigai(at)ak(dot)jp(dot)nec(dot)com> writes:
>>>>>> The attached one also clean up ATPrepAddColumn() and ATExecAddColumn() code,
>>>>>> not only ATPrepAlterColumnType(), according to what I mentioned above.
>>>>>
>>>>> What exactly do you claim is wrong with the ADD COLUMN case?
>>>>
>>>> ADD COLUMN case works correctly, but it takes unnecessary loops,
>>>> because the find_all_inheritors() didn't provide the value to be
>>>> set on the new pg_attribute.attinhcount.
>>>>
>>>> I'm saying it can be rewritten in more graceful manner using the
>>>> new expected_parents argument.
>>>
>>> The subject line of this thread is getting less and less appropriate
>>> to the content thereof.
>>>
>>> I am not in favor of doing anything for 9.0 that is not a bug fix.
>>
>> Are you talking about ATPrepAddColumn() only? Or both of ATPrepAddColumn()
>> and ATPrepAlterColumnType()?
>>
>> My motivation to clean up ATPrepAddColumn() is less than the bugfix.
>
> I'm making a general statement - if something is BROKEN (like the
> rename case we just dealt with), we should look at fixing it. If it's
> just something that could be cleaned up or done more nicely, we should
> leave it alone for now.

OK, Please forget the second patch.

The former patch (pgsql-fix-inherit-attype.1.patch) just fixes the matter
in ALTER COLUMN TYPE case. Do you think it is a reasonable change for
the 9.0 release?

Thanks,
--
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-02-02 04:33:44 Re: PITR - Bug or feature?
Previous Message Alex Hunsaker 2010-02-02 02:53:05 Re: Package namespace and Safe init cleanup for plperl UPDATE 3 [PATCH]