[PATCH] Fix psql tab completion for REPACK boolean options

From: Baji Shaik <baji(dot)pgdev(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Fix psql tab completion for REPACK boolean options
Date: 2026-05-11 19:45:34
Message-ID: CA+fm-RNZpy7MAceR9gSyy833H_uL-fTx0LxO73RnvwEaprpuRA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 Content-Type Size
0001-Fix-psql-tab-completion-for-REPACK-boolean-options.patch application/octet-stream 1.4 KB

Browse pgsql-hackers by date

  From Date Subject
Previous Message Antonin Houska 2026-05-11 19:30:01 Re: Adding REPACK [concurrently]