Tab-complete for CREATE EVENT TRIGGER ON TABLE_REWRITE

Started by houzj.fnst@fujitsu.comover 3 years ago2 messages
#1houzj.fnst@fujitsu.com
houzj.fnst@fujitsu.com
1 attachment(s)

Hi hackers,

When working on some table_rewrite related projects, I noticed that we don’t
have tab-complete for "ON table_rewrite" when creating the event trigger. I think it
might be better to add this. Here is the patch. Thoughts ?

Best regards,
Hou zhijie

Attachments:

0001-Add-tab-complete-for-table_rewrite.patchapplication/octet-stream; name=0001-Add-tab-complete-for-table_rewrite.patchDownload
From 6d0126812a1362a9edadc836be19f9f12db4d1cb Mon Sep 17 00:00:00 2001
From: "Hou Zhijie" <houzj.fnst@cn.fujitsu.com>
Date: Wed, 25 May 2022 11:31:06 +0800
Subject: [PATCH] Add tab complete for table_rewrite

Tab-complete CREATE EVENT TRIGGER ON TABLE_REWRITE

---
 src/bin/psql/tab-complete.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 55af9eb..e1cc753 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3408,7 +3408,8 @@ psql_completion(const char *text, int start, int end)
 		COMPLETE_WITH("ON");
 	/* Complete CREATE EVENT TRIGGER <name> ON with event_type */
 	else if (Matches("CREATE", "EVENT", "TRIGGER", MatchAny, "ON"))
-		COMPLETE_WITH("ddl_command_start", "ddl_command_end", "sql_drop");
+		COMPLETE_WITH("ddl_command_start", "ddl_command_end", "sql_drop",
+					  "table_rewrite");
 
 	/*
 	 * Complete CREATE EVENT TRIGGER <name> ON <event_type>.  EXECUTE FUNCTION
-- 
2.7.2.windows.1

#2Michael Paquier
michael@paquier.xyz
In reply to: houzj.fnst@fujitsu.com (#1)
Re: Tab-complete for CREATE EVENT TRIGGER ON TABLE_REWRITE

On Wed, May 25, 2022 at 03:40:51AM +0000, houzj.fnst@fujitsu.com wrote:

When working on some table_rewrite related projects, I noticed that we don’t
have tab-complete for "ON table_rewrite" when creating the event trigger. I think it
might be better to add this. Here is the patch. Thoughts ?

Indeed. Will fix, thanks.
--
Michael