[PATCH] psql: Complete INDEX after REPACK USING

Started by Sho Ito20 days ago3 messageshackers

Thread notes

1 note#bug
hackorum-bot#bug
hackorum-bot
2 days ago

@global #bug

#bug
Jump to latest
#1Sho Ito
i.sho.0628@gmail.com

Hi hackers,

After manually typing `REPACK USING ` and pressing Tab, psql inserts
another `USING INDEX`, producing `REPACK USING USING INDEX`. After an
explicit table name, `REPACK tab1 USING ` offers no completion.

The attached fix completes `INDEX` after `USING`, with or without an
option list, table name, or column list.

Regression tests are attached as a separate patch.

I tested on master with assertions enabled. The new tests fail without
the fix, and all psql TAP tests pass with it.

I have also posted a separate fix for index completion after a
`REPACK` column list [1]/messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com. The two fixes are independent.

[1]: /messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com
/messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com

Thanks,
Sho

--
=======================================
*Sho Ito (Sean)*

E-mail: i.sho.0628@gmail.com
LinkedIn: *https://www.linkedin.com/in/sho-ito-0628/
<https://www.linkedin.com/in/sho-ito-0628/>*
GitHub: https://github.com/sean0628/
=======================================

Attachments:

v1-0001-psql-Complete-INDEX-after-REPACK-USING.patchapplication/octet-stream; name=v1-0001-psql-Complete-INDEX-after-REPACK-USING.patchDownload+7-0
v1-0001-psql-Test-completion-after-REPACK-USING.patchapplication/octet-stream; name=v1-0001-psql-Test-completion-after-REPACK-USING.patchDownload+36-0
#2Chao Li
li.evan.chao@gmail.com
In reply to: Sho Ito (#1)
Re: [PATCH] psql: Complete INDEX after REPACK USING

On Nov 9, 2026, at 06:23, Sho Ito <i.sho.0628@gmail.com> wrote:

Hi hackers,

After manually typing `REPACK USING ` and pressing Tab, psql inserts
another `USING INDEX`, producing `REPACK USING USING INDEX`. After an
explicit table name, `REPACK tab1 USING ` offers no completion.

The attached fix completes `INDEX` after `USING`, with or without an
option list, table name, or column list.

Regression tests are attached as a separate patch.

I tested on master with assertions enabled. The new tests fail without
the fix, and all psql TAP tests pass with it.

I have also posted a separate fix for index completion after a
`REPACK` column list [1]. The two fixes are independent.

[1] /messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com

Thanks,
Sho

--
=======================================
Sho Ito (Sean)

E-mail: i.sho.0628@gmail.com
LinkedIn: https://www.linkedin.com/in/sho-ito-0628/
GitHub: https://github.com/sean0628/
=======================================
<v1-0001-psql-Complete-INDEX-after-REPACK-USING.patch><v1-0001-psql-Test-completion-after-REPACK-USING.patch>

Please see my comment in the other your patch of “Fix REPACK index completion after a column list”.

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

#3Sho Ito
i.sho.0628@gmail.com
In reply to: Chao Li (#2)
Re: [PATCH] psql: Complete INDEX after REPACK USING

Please see my comment in the other your patch of “Fix REPACK index
completion after a column list”.

Hi Chao,

Thanks for reviewing. This fix is now included in the combined v2 patch
in the column-list thread [1]/messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com, so I am withdrawing Commitfest entry
#7610 [2]https://commitfest.postgresql.org/patch/7610/ in favour of #7611 [3]https://commitfest.postgresql.org/patch/7611/.

[1]: /messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com
/messages/by-id/CAG7L5+7Xmus+JLa0m=Lpw49wU=secPm5dzNd2ibmfvhdSYEfqA@mail.gmail.com
[2]: https://commitfest.postgresql.org/patch/7610/
[3]: https://commitfest.postgresql.org/patch/7611/

Thanks,
Sho

--
=======================================
*Sho Ito (Sean)*

E-mail: i.sho.0628@gmail.com
LinkedIn: *https://www.linkedin.com/in/sho-ito-0628/
<https://www.linkedin.com/in/sho-ito-0628/>*
GitHub: https://github.com/sean0628/
=======================================