Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-28 Thread Michael Paquier
On Fri, Oct 26, 2018 at 05:11:59PM +0100, Dagfinn Ilmari Mannsåker wrote: > Thanks! I've updated the commitfest entry with you as the committer and > Tom as the reviewer, and marked it as committed. Thanks a lot for updating the CF app. I have been a bit sloppy here. -- Michael signature.asc D

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Dagfinn Ilmari Mannsåker
Michael Paquier writes: > On Fri, Oct 26, 2018 at 09:08:13PM +0900, Michael Paquier wrote: >> I didn't think that this was much of a big deal as the deprecated >> grammar is still supported on v11, but as both of you think in this >> sense I am fine to patch REL_11_STABLE as well. Please just wa

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Michael Paquier
On Fri, Oct 26, 2018 at 09:08:13PM +0900, Michael Paquier wrote: > I didn't think that this was much of a big deal as the deprecated > grammar is still supported on v11, but as both of you think in this > sense I am fine to patch REL_11_STABLE as well. Please just wait a > bit... Done for the par

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > A related issue is whether we should change pg_get_triggerdef() to emit > the new syntax as well (in HEAD only, since it would break things that > parse the output). No, because pg_get_triggerdef() does not know what its outpu

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > Michael Paquier writes: >> On Fri, Oct 26, 2018 at 09:31:48AM +0900, Michael Paquier wrote: >>> Committed 0001 now which adds tab completion for CREATE TRIGGER. > >> And 0002 is committed as well. Thanks for the patches! > > The committed patches look sane to me, but should

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Michael Paquier
On Fri, Oct 26, 2018 at 11:15:19AM +0100, Dagfinn Ilmari Mannsåker wrote: > Tom Lane writes: >> The committed patches look sane to me, but should we back-patch into 11? >> This isn't quite a bug fix maybe, but it's inconsistent if v11 server & >> docs recommend this syntax while v11 psql doesn't p

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > Michael Paquier writes: >> On Fri, Oct 26, 2018 at 09:31:48AM +0900, Michael Paquier wrote: >>> Committed 0001 now which adds tab completion for CREATE TRIGGER. > >> And 0002 is committed as well. Thanks for the patches! Thanks for reviewing and committing! > The committed

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-26 Thread Tom Lane
Michael Paquier writes: > On Fri, Oct 26, 2018 at 09:31:48AM +0900, Michael Paquier wrote: >> Committed 0001 now which adds tab completion for CREATE TRIGGER. > And 0002 is committed as well. Thanks for the patches! The committed patches look sane to me, but should we back-patch into 11? This

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Michael Paquier
On Fri, Oct 26, 2018 at 09:31:48AM +0900, Michael Paquier wrote: > Committed 0001 now which adds tab completion for CREATE TRIGGER. > Something you missed is that we should still be able to complete with > PROCEDURE or FUNCTION (depending on the backend version) if CREATE > TRIGGER .. EXECUTE is pr

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Michael Paquier
On Thu, Oct 25, 2018 at 05:02:32PM +0100, Dagfinn Ilmari Mannsåker wrote: > Okay, revised patches attached. I also tweaked the CREATE EVENT TRIGGER > completion to accept multple IN () > conditions seprated by AND in the WHEN clause (but not to suggest that, > since we only actually support one ,

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Michael Paquier
On Thu, Oct 25, 2018 at 12:52:01PM +0100, Tom Lane wrote: > Michael Paquier writes: >> To keep the code simple, you could do something like that, by checking >> the head keywords for a match with CREATE TRIGGER, and then move all the >> existing conditions within it: >> ... >> char *execute_ke

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: >> Tom Lane writes: >>> Yeah. Why don't we keep the existing behavior of completing both >>> words at once, but make it server-version-dependent which completion >>> you get? > >> I did that initially, but

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Tom Lane
Michael Paquier writes: > To keep the code simple, you could do something like that, by checking > the head keywords for a match with CREATE TRIGGER, and then move all the > existing conditions within it: > ... > char *execute_keyword; > ... > blah and use execute_keyword in the lists;

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Michael Paquier
On Thu, Oct 25, 2018 at 12:25:33PM +0100, Dagfinn Ilmari Mannsåker wrote: > I did that initially, but because COMPLETE_WITH() requres constant > arguments, I had to repeat the whole list with just changing PROCEDURE > to FUNCTION, which I thought was undesirably repetitive. If there's a > more con

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Dagfinn Ilmari Mannsåker
Michael Paquier writes: > + 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. The * is a wildcard, so it completes EXECUTE after CREATE TRIGGER …

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Tom Lane
ilm...@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) writes: > Tom Lane writes: >> Yeah. Why don't we keep the existing behavior of completing both >> words at once, but make it server-version-dependent which completion >> you get? > I did that initially, but because COMPLETE_WITHc() re

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > Michael Paquier writes: >> 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

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-25 Thread Tom Lane
Michael Paquier writes: > 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 t

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-24 Thread Michael Paquier
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 "

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-24 Thread Dagfinn Ilmari Mannsåker
David Fetter writes: > On Wed, Oct 24, 2018 at 08:43:05AM +0900, Michael Paquier wrote: >> On Tue, Oct 23, 2018 at 12:26:35PM +0100, Dagfinn Ilmari Mannsåker wrote: >> > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE >> > FUNCTION as well as EXECUTE PROCEDURE did not update t

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread David Fetter
On Wed, Oct 24, 2018 at 08:43:05AM +0900, Michael Paquier wrote: > On Tue, Oct 23, 2018 at 12:26:35PM +0100, Dagfinn Ilmari Mannsåker wrote: > > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE > > FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion > > in psq

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread Michael Paquier
On Tue, Oct 23, 2018 at 12:26:35PM +0100, Dagfinn Ilmari Mannsåker wrote: > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE > FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion > in psql to match. Please find attached two patches that do this for > CREATE T

Re: [PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread Dagfinn Ilmari Mannsåker
ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > Hi hackers, > > The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE > FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion > in psql to match. Please find attached two patches that do this for > CREATE TRIGG

[PATCH] Tab complete EXECUTE FUNCTION for CREATE (EVENT) TRIGGER

2018-10-23 Thread Dagfinn Ilmari Mannsåker
Hi hackers, The last-minute change for CREATE (EVENT) TRIGGER to accept EXECUTE FUNCTION as well as EXECUTE PROCEDURE did not update the tab completion in psql to match. Please find attached two patches that do this for CREATE TRIGGER and CREATE EVENT TRIGGER, respectively. To keep the duplicati