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 8f1bd2324f335b27a9a7c84562e2a90b@oss.nttdata.com
Whole thread Raw
In response to Re: [PATCH]Feature improvement for MERGE tab completion  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: [PATCH]Feature improvement for MERGE tab completion
List 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

pgsql-hackers by date:

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