Re: Add missing tab completion for VACUUM and ANALYZE with ONLY option

Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>

From: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
To: vignesh C <vignesh21@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, postgresql.wizard@gmail.com
Date: 2025-03-19T10:21:54Z
Lists: pgsql-hackers
On 19.03.2025 12:55, vignesh C wrote:
>> Looks good overall. However, after pressing Tab, ONLY appears in the completion list, but it doesn't autocomplete after typing the first letter.
> In which case you noticed this?


Ah, I just tested it using these examples from the regression tests:

CREATE TABLE only_parted (a int, b text) PARTITION BY LIST (a);
CREATE TABLE only_parted1 PARTITION OF only_parted FOR VALUES IN (1);

ONLY doesn't autocomplete here because the table names begin with 
"only...", which conflicts with autocompletion—this was my oversight.

----------

Everything seems fine with the ANALYZE command autocompletion. Regarding 
VACUUM, I'm not entirely convinced we should provide autocompletion in 
every case. I'd prefer to keep the behavior from the v3 patch because 
the original intention behind adding the ONLY keyword was specifically 
for collecting statistics exclusively from parent tables. Therefore, 
autocompletion makes sense primarily for the ANALYZE case.

Any thoughts?

--
Best regaards,
Ilia Evdokimov,
Tantor Labs LLC.

Commits

  1. psql: Add tab completion for VACUUM and ANALYZE ... ONLY option.