Re: [PATCH] psql: Fix REPACK index completion after a column list

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Sho Ito <i(dot)sho(dot)0628(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] psql: Fix REPACK index completion after a column list
Date: 2026-11-09 01:07:39
Message-ID: F50AED62-AA17-49D8-87EB-E30A919341BE@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Nov 9, 2026, at 06:12, Sho Ito <i(dot)sho(dot)0628(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> After a column list, psql's index completion for `REPACK` offers indexes
> from unrelated tables. For example:
>
> ```
> REPACK (ANALYZE) tab1 (c1) USING INDEX <Tab>
> ```
>
> The completion code uses `prev3_wd` as the table name, but that word is
> the column list in this form. The table-specific query returns nothing,
> and completion falls back to listing all indexes.
>
> The attached fix uses `prev4_wd` when a column list is present. It also
> completes `USING INDEX` after the column list.
>
> The regression tests are in a separate patch extending the existing
> `src/bin/psql/t/010_tab_completion.pl`.
>
> Thanks,
> Sho
>
> --
> =======================================
> Sho Ito (Sean)
>
> E-mail: i(dot)sho(dot)0628(at)gmail(dot)com
> LinkedIn: https://www.linkedin.com/in/sho-ito-0628/
> GitHub: https://github.com/sean0628/
> =======================================
> <v1-0001-psql-Fix-REPACK-index-completion-after-a-column-list.patch><v1-0001-psql-Test-REPACK-index-completion-after-a-column-list.patch>

Hi Sho,

Thanks for the patches. Both this patch and your other patch, "Complete INDEX after REPACK USING", look good to me.

Since these two patches are closely related, I would suggest combining them into a single patch. I applied this patch first, but when I tried to apply the other one, I encountered a conflict. Combining them would make it easier for reviewers and committers to review and apply the changes.

One other minor nit is that the test patch should normally be named v1-0002 rather than v1-0001. If you put both commits on the same branch and run "git format-patch", it will generate two patch files with 0001 and 0002 prefixes, respectively.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-11-09 01:08:51 Re: [PATCH] psql: Complete INDEX after REPACK USING
Previous Message Tomas Vondra 2026-11-09 00:12:22 two statement_timeout race conditions