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: [email protected]
LinkedIn: *https://www.linkedin.com/in/sho-ito-0628/
<https://www.linkedin.com/in/sho-ito-0628/>*
GitHub: https://github.com/sean0628/
=======================================

Attachment: v1-0001-psql-Fix-REPACK-index-completion-after-a-column-list.patch
Description: Binary data

Attachment: v1-0001-psql-Test-REPACK-index-completion-after-a-column-list.patch
Description: Binary data

Reply via email to