Re: Feature improvement for FETCH tab completion - Mailing list pgsql-hackers

From btnakamichin
Subject Re: Feature improvement for FETCH tab completion
Date
Msg-id e41e668e4e68dfd9e4a74ce98e54eb2c@oss.nttdata.com
Whole thread Raw
In response to Re: Feature improvement for FETCH tab completion  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Feature improvement for FETCH tab completion
List pgsql-hackers
2020-09-25 15:38 に Fujii Masao さんは書きました:
> 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,

I’m Sorry, I forgot to include pgsql_hackers in the cc, so I resend it

Thank you, I appreciate your comment.

I have attached patch with newline.

Regards,

NaokiNakamichi
Attachment

pgsql-hackers by date:

Previous
From: "k.jamison@fujitsu.com"
Date:
Subject: RE: [Patch] Optimize dropping of relation buffers using dlist
Next
From: Dilip Kumar
Date:
Subject: Re: Logical replication from PG v13 and below to PG v14 (devel version) is not working.