Re: DOC: fixes multiple errors in alter table doc

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: DOC: fixes multiple errors in alter table doc
Date: 2026-03-06 07:52:41
Message-ID: 3692340C-3E24-46EE-94EE-2CE88B6F470E@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Mar 6, 2026, at 14:48, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>
>
>> On Mar 6, 2026, at 14:40, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>
>> On Thu, Mar 5, 2026 at 2:06 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>>> -- alter noexisting table
>>>> ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft1 ADD COLUMN c4 integer;
>>>> +ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft1 ADD c5 integer;
>>>> <snip>
>>>> ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft1 DROP COLUMN IF EXISTS no_column;
>>>> +ALTER FOREIGN TABLE IF EXISTS doesnt_exist_ft1 DROP IF EXISTS no_column;
>>>>
>>>> Regarding 0002 patch, could you explain the reason for adding these
>>>> two additional tests? I was just curious why because other four tests that
>>>> the patch adds seem sufficient.
>>>
>>> They are combinations of “IF [NOT] EXISTS” and omitting “COLUMN", I added them just for better coverage.
>>
>> Which table-level or column-level "IF [NOT] EXISTS" are you referring to?
>> If you mean the combination of column-level "IF [NOT] EXISTS" with
>> "COLUMN" omitted, then the first test above should be "ALTER FOREIGN TABLE
>> IF EXISTS doesnt_exist_ft1 ADD IF NOT EXISTS c5 integer"?
>>
>> Regards,
>>
>> --
>> Fujii Masao
>
> I meant to say column-level. Yes, the first test seems not needed. My brain was buffering! I will revisit the test cases and make an update later.
>
> Best regards,
> --
> Chao Li (Evan)
> HighGo Software Co., Ltd.
> https://www.highgo.com/
>

PFA v6. The two test cases on table level “IF EXISTS” are removed. So, now the patch adds totally 4 test cases: 2 for omitting COLUMN, 2 for combinations of column level “IF [NOT] EXISTS” and omitting COUMN.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v6-0001-doc-clarify-ALTER-FOREIGN-TABLE-ADD-DROP-COLUMN-s.patch application/octet-stream 6.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rafia Sabih 2026-03-06 07:56:42 Re: Mis-use of type BlockNumber?
Previous Message Fujii Masao 2026-03-06 07:48:06 Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record