Re: [PATCH]Feature improvement for MERGE tab completion

From: bt22kawamotok <bt22kawamotok(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH]Feature improvement for MERGE tab completion
Date: 2022-09-14 09:12:52
Message-ID: 8f1bd2324f335b27a9a7c84562e2a90b@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> + else if (TailMatches("MERGE", "INTO", MatchAny, "USING") ||
> + TailMatches("MERGE", "INTO", MatchAny, MatchAny, "USING") ||
> + TailMatches("MERGE", "INTO", MatchAny, "AS", MatchAny, "USING"))
> COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables);
>
> + else if (TailMatches("MERGE", "INTO", MatchAny, "AS", MatchAny,
> "USING") ||
> + TailMatches("MERGE", "INTO", MatchAny, MatchAny, "USING"))
> COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables);
>
> The latter seems redundant and can be removed. The former seems to
> cover all the cases where the latter covers.

> + else if (TailMatches("USING", MatchAny, "ON", MatchAny) ||
> + TailMatches("USING", MatchAny, "ON", MatchAny,
> MatchAnyExcept("When"), MatchAnyExcept("When")) ||
> + TailMatches("USING", MatchAny, "AS", MatchAny, "ON", MatchAny) ||
> + TailMatches("USING", MatchAny, "AS", MatchAny, "ON", MatchAny,
> MatchAnyExcept("When"), MatchAnyExcept("When")) ||
> + TailMatches("USING", MatchAny, MatchAny, "ON", MatchAny) ||
> + TailMatches("USING", MatchAny, MatchAny, "ON", MatchAny,
> MatchAnyExcept("When"), MatchAnyExcept("When")))
>
> "When" should be "WHEN"?
>
>
> Regards,

Thanks for reviewing.

Sorry for making such a simple mistake.
I fixed it in v6.

> Not only table but also view, foreign table, etc can be specified after
> USING in MERGE command. So ISTM that Query_for_list_of_selectables
> should be used at the above tab-completion, instead of
> Query_for_list_of_tables.
> Thought?

That's nice idea!
I took that in v6.

Regards,

Kotaro Kawamoto

Attachment Content-Type Size
fix_tab_completion_merge_v6.patch text/x-diff 4.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Przemysław Sztoch 2022-09-14 09:26:41 FTS parser - missing UUID token type
Previous Message Bharath Rupireddy 2022-09-14 08:54:12 Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)