| 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-24 22:01:16 |
| Message-ID: | CAD21AoA3xkbXi3Ucnv7b5XxebQm=K3Btyra_qfuybaHULFxvSQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Dec 22, 2025 at 5:37 PM Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
>
> On Mon, 22 Dec 2025 13:55:59 -0800
> Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> > 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
>
> Thank you for your review! I agree that this 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.
>
> Similar inappropriate suggestions can occur in other cases where
> MatchAnyN is used. For example:
>
> postgres=# truncate only t cascade restart identity
> CASCADE RESTRICT
Right.
I've pushed the patch.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2025-12-24 23:37:54 | Re: Docs: Standardize "cannot" usage in SGML source |
| Previous Message | Matthias van de Meent | 2025-12-24 21:49:08 | Re: Fixing the btree_gist inet mess |