Hi,

I noticed that psql's tab completion for REPACK's parenthesized
boolean options (ANALYZE, CONCURRENTLY, VERBOSE) does not offer
ON/OFF after typing one of these keywords.
For example:
    REPACK (VERBOSE <Tab>       -- nothing offered
  VACUUM (VERBOSE <Tab>       -- correctly offers ON/OFF

The issue is in tab-complete.in.c. The code uses:

    TailMatches("ANALYZE", "CONCURRENTLY", "VERBOSE")

With comma-separated arguments, TailMatches matches a sequence of
consecutive words. So this only matches when all three words appear
in order, which is not a valid REPACK syntax.

The fix is to use pipe-separated alternatives (matching any one of
the keywords), consistent with how VACUUM handles the same pattern:

    TailMatches("ANALYZE|CONCURRENTLY|VERBOSE")

Patch attached.

Thanks,
Baji Shaik
AWS RDS

Attachment: 0001-Fix-psql-tab-completion-for-REPACK-boolean-options.patch
Description: Binary data

Reply via email to