Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER
Date
Msg-id 20181025034237.GF5902@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Responses Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
List pgsql-hackers
On Wed, Oct 24, 2018 at 10:36:41AM +0100, Dagfinn Ilmari Mannsåker wrote:
> Fair point. I was unsure about whether to complete every supported
> variant or just the new one.  Updated patches attached.

One problem with this approach is that a user needs to use twice tab.
The first time is to show "EXECUTE", and the second time is to show
automatically "PROCEDURE" or "FUNCTION" automatically.  The patch as it
stands is less complicated, but I can imagine as well that what's
propose could confuse people into thinking that they need to type
something after EXECUTE has showed up on the prompt.  I vote for
simplicity and there are other code paths where completion for one
element only is done.  Any objections?

+   else if (HeadMatches("CREATE", "TRIGGER") && TailMatches("WHEN", "(*)"))
+       COMPLETE_WITH("EXECUTE");

It seems to me that this should be removed, it would fail at parsing if
completed.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: Re: Question about xmloption and pg_restore
Next
From: David Rowley
Date:
Subject: A small tweak to some comments for PartitionKeyData