Re: psql: Fix tab completion for VACUUM option values

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: Fix tab completion for VACUUM option values
Date: 2025-12-22 21:55:59
Message-ID: CAD21AoBqD1on8pkp4j8j4o14abiEBFgjgiDwtzNr1p=pP1U8-Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Dec 22, 2025 at 9:15 AM Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
>
> Hi,
>
> I noticed that tab completion for VACUUM option values is broken.
> For example, ON or OFF should be suggested after
> "VACUUM (VERBOSE", but this currently does not work.
>
> I believe this issue was introduced by commit 8a3e4011, which added
> tab completion for the ONLY option of VACUUM and ANALYZE, along with
> some code simplification using MatchAnyN.
>
> In addition, tab completion for the ONLY option is insufficient:
> "ONLY" is not suggested immediately after a completed option list,
> for example in "VACUUM (...) ONLY" or "ANALYZE (...) ONLY".
>
> I've attached a patch to fix these issues.
>

I agree with your analysis. I think the patch should be backpatched to v18

FYI due to the simplification by using MatchAnyN, vacuum options are
suggested at inappropriate positions:

postgres(1:2376453)=# vacuum (verbose on) freeze
ANALYZE ONLY VERBOSE
information_schema. public. t

Given that it's not common usage, we can live with that.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-12-22 22:04:05 Re: Vectorize pg_visibility.pg_visibility_map_summary
Previous Message Tom Lane 2025-12-22 21:50:38 Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain