[PATCH] Add tab completion for EXECUTE after EXPLAIN - Mailing list pgsql-hackers

From ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Subject [PATCH] Add tab completion for EXECUTE after EXPLAIN
Date
Msg-id 871r75gd0i.fsf@wibble.ilmari.org
Whole thread Raw
Responses Re: [PATCH] Add tab completion for EXECUTE after EXPLAIN
List pgsql-hackers
Hi hackers,

Here's a patch adding EXECUTE to the list of of commands tab completed
after the various EXPLAIN variants.

- ilmari

From a303b7b44442e505d4cdd65a0bd1fdc031488a14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Wed, 4 Aug 2021 12:07:24 +0100
Subject: [PATCH] Tab complete EXECUTE after EXPLAIN

---
 src/bin/psql/tab-complete.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 064892bade..5d7feece59 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3222,7 +3222,7 @@ psql_completion(const char *text, int start, int end)
  */
     else if (Matches("EXPLAIN"))
         COMPLETE_WITH("SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DECLARE",
-                      "ANALYZE", "VERBOSE");
+                      "EXECUTE", "ANALYZE", "VERBOSE");
     else if (HeadMatches("EXPLAIN", "(*") &&
              !HeadMatches("EXPLAIN", "(*)"))
     {
@@ -3241,11 +3241,12 @@ psql_completion(const char *text, int start, int end)
     }
     else if (Matches("EXPLAIN", "ANALYZE"))
         COMPLETE_WITH("SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DECLARE",
-                      "VERBOSE");
+                      "EXECUTE", "VERBOSE");
     else if (Matches("EXPLAIN", "(*)") ||
              Matches("EXPLAIN", "VERBOSE") ||
              Matches("EXPLAIN", "ANALYZE", "VERBOSE"))
-        COMPLETE_WITH("SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DECLARE");
+        COMPLETE_WITH("SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DECLARE",
+                      "EXECUTE");
 
 /* FETCH && MOVE */
 
-- 
2.30.2


pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Commitfest overflow
Next
From: Tom Lane
Date:
Subject: Re: Assert triggered during RE_compile_and_cache