Re: [PATCH]Feature improvement for MERGE tab completion

From: bt22kawamotok <bt22kawamotok(at)oss(dot)nttdata(dot)com>
To: Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH]Feature improvement for MERGE tab completion
Date: 2022-09-12 06:53:46
Message-ID: c5730fb146c8ded48d537724e1456bfb@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fix_tab_completion_merge_v2.patch text/x-diff 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-09-12 06:53:53 Re: Expand palloc/pg_malloc API
Previous Message Andrey Borodin 2022-09-12 06:52:28 pg_stat_statements locking