Re: The command tag of "ALTER MATERIALIZED VIEW RENAME COLUMN"

Поиск
Список
Период
Сортировка
От Ibrar Ahmed
Тема Re: The command tag of "ALTER MATERIALIZED VIEW RENAME COLUMN"
Дата
Msg-id CALtqXTd3-XuQQ=8q8ymROLsyg8T0POV6qYMPaK2R-PS_51fB3w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: The command tag of "ALTER MATERIALIZED VIEW RENAME COLUMN"  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: The command tag of "ALTER MATERIALIZED VIEW RENAME COLUMN"  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers


On Fri, Nov 1, 2019 at 8:00 AM Fujii Masao <masao.fujii@gmail.com> wrote:
On Fri, Nov 1, 2019 at 6:34 AM Ibrar Ahmed <ibrar.ahmad@gmail.com> wrote:
>
>
>
> On Thu, Oct 31, 2019 at 6:56 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Fujii Masao <masao.fujii@gmail.com> writes:
>> > ... I found that the command tag of
>> > ALTER MATERIALIZED VIEW RENAME COLUMN is "ALTER TABLE", not "ALTER VIEW".
>>
>> >     =# ALTER MATERIALIZED VIEW hoge RENAME COLUMN j TO x;
>> >     ALTER TABLE
>>
>> > Is this intentional? Or bug?
>>
>> Seems like an oversight.

Thanks for the check!

> The same issue is with ALTER FOREIGN TABLE

Yes.

> Attached patch fixes that for ALTER VIEW , ALTER MATERIALIZED VIEW and ALTER FOREIGN TABLE

You introduced subtype in your patch, but I think it's better and simpler
to just give relationType to AlterObjectTypeCommandTag()
if renaming the columns (i.e., renameType = OBJECT_COLUMN).

That's works perfectly along with future oversight about the command tag.
 
To avoid this kind of oversight about command tag, I'd like to add regression
tests to make sure that SQL returns valid and correct command tag.
But currently there seems no mechanism for such test, in regression
test. Right??
 
Do we really need a regression test cases for such small oversights?
 
Maybe we will need that mechanism.

Regards,

--
Fujii Masao


--
Ibrar Ahmed

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Block level parallel vacuum
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: fe-utils - share query cancellation code