Re: [PATCH]Feature improvement for MERGE tab completion - Mailing list pgsql-hackers

From bt22kawamotok
Subject Re: [PATCH]Feature improvement for MERGE tab completion
Date
Msg-id c5730fb146c8ded48d537724e1456bfb@oss.nttdata.com
Whole thread Raw
In response to Re: [PATCH]Feature improvement for MERGE tab completion  (Shinya Kato <Shinya11.Kato@oss.nttdata.com>)
Responses Re: [PATCH]Feature improvement for MERGE tab completion
List pgsql-hackers
>     else if (TailMatches("USING", MatchAny, "ON", MatchAny, "WHEN"))
>         COMPLETE_WITH("MATCHED", "NOT MATCHED");
>     else if (TailMatches("USING", MatchAny, "AS", MatchAny, "ON",
> MatchAny, "WHEN"))
>         COMPLETE_WITH("MATCHED", "NOT MATCHED");
>     else if (TailMatches("USING", MatchAny, MatchAny, "ON", MatchAny, 
> "WHEN"))
>         COMPLETE_WITH("MATCHED", "NOT MATCHED");
> 
> I thought it would be better to describe this section as follows,
> summarizing the conditions
> 
>     else if (TailMatches("USING", MatchAny, "ON", MatchAny, "WHEN") ||
>              TailMatches("USING", MatchAny, "AS", MatchAny, "ON", MatchAny, 
> "WHEN") ||
>              TailMatches("USING", MatchAny, MatchAny, "ON", MatchAny, "WHEN"))
>         COMPLETE_WITH("MATCHED", "NOT MATCHED");
> 
> There are similar redundancies in the tab completion of MERGE
> statement, so why not fix that as well?

Thanks for your review.

A new patch has been created to reflect the changes you indicated.
I also found a problem that "DO NOTHING" is not completed when type 
"WHEN MATCHED <tab>", so I fixed it as well.

Regards,

Kotaro Kawamoto
Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: pg_stat_statements locking
Next
From: Peter Eisentraut
Date:
Subject: Re: Expand palloc/pg_malloc API