Re: 15beta1 tab completion of extension versions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 15beta1 tab completion of extension versions
Date
Msg-id 1285253.1656871259@sss.pgh.pa.us
Whole thread Raw
In response to Re: 15beta1 tab completion of extension versions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: 15beta1 tab completion of extension versions
List pgsql-hackers
I wrote:
> Noah Misch <noah@leadboat.com> writes:
>> "ALTER EXTENSION hstore UPDATE;" is a valid command (updates to the
>> control file default version).  Hence, I think the v14 behavior was better.

> Hmm ... good point, let me think about that.

After consideration, my preferred solution is just this:

diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 463cac9fb0..c5cafe6f4b 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1927,7 +1927,7 @@ psql_completion(const char *text, int start, int end)
 
     /* ALTER EXTENSION <name> */
     else if (Matches("ALTER", "EXTENSION", MatchAny))
-        COMPLETE_WITH("ADD", "DROP", "UPDATE TO", "SET SCHEMA");
+        COMPLETE_WITH("ADD", "DROP", "UPDATE", "SET SCHEMA");
 
     /* ALTER EXTENSION <name> UPDATE */
     else if (Matches("ALTER", "EXTENSION", MatchAny, "UPDATE"))

This will require one extra <TAB> when what you want is to update to
a specific version, but I doubt that that's going to bother anyone
very much.  I don't want to try to resurrect the v14 behavior exactly
because it's too much of a mess from a quoting standpoint.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: O(n) tasks cause lengthy startups and checkpoints
Next
From: Noah Misch
Date:
Subject: Re: 15beta1 tab completion of extension versions