Re: Feature improvement for FETCH tab completion

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: btnakamichin <btnakamichin(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Feature improvement for FETCH tab completion
Date: 2020-09-25 06:38:46
Message-ID: bea7d871-affc-d190-f72f-5369aa663c6d@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/09/25 14:24, btnakamichin wrote:
> Hello!
>
> I’d like to improve the FETCH tab completion.
>
> The FETCH tab completion . Therefore, this patch fixes the problem.
>
> Previous function completed one of FORWARD, BACKWARD, RELATIVE, ABSOLUTE, but now it completes one of FORWARD, BACKWARD, RELATIVE, ABSOLUTE, ALL, NEXT, PRIOR, FIRST, LAST and Corresponded to later IN and FROM clauses.

Thanks for the patch! Here are review comments.

+ /* Complete FETCH BACKWARD or FORWARD with one of ALL */
+ else if (Matches("FETCH|MOVE", "BACKWARD|FORWARD"))
+ COMPLETE_WITH("ALL");

Not only "ALL" but also "FROM" and "IN" should be displayed here
because they also can follow "BACKWARD" and "FORWARD"?

else if (Matches("FETCH|MOVE", MatchAny, MatchAny))
+ else if (Matches("FETCH|MOVE", "ABSOLUTE|BACKWARD|FORWARD|RELATIVE", MatchAny))
+ COMPLETE_WITH("FROM", "IN");

This change seems to cause "FETCH FORWARD FROM <tab>" to display "FROM"
and "IN". To avoid this confusing tab-completion, we should use something like
MatchAnyExcept("FROM|IN") here, instead?

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-09-25 06:44:28 Re: [patch] Concurrent table reindex per-index progress reporting
Previous Message Peter Smith 2020-09-25 06:34:03 Re: Load TIME fields - proposed performance improvement