pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: 15beta1 tab completion of extension versions
Date: Sun, 3 Jul 2022 12:11:22 -0700
Message-ID: <20220703191122.GA2520965@rfd.leadboat.com> (raw)
In-Reply-To: <1285253.1656871259@sss.pgh.pa.us>
References: <CAMkU=1yV+egSYrzWvbDY8VZ6bKEMrKbzxr-HTuiHi+wDgSUMgA@mail.gmail.com>
	<1803867.1655596168@sss.pgh.pa.us>
	<1930937.1655614573@sss.pgh.pa.us>
	<20220703083217.GB2476530@rfd.leadboat.com>
	<1212507.1656858578@sss.pgh.pa.us>
	<1285253.1656871259@sss.pgh.pa.us>

On Sun, Jul 03, 2022 at 02:00:59PM -0400, Tom Lane wrote:
> 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.

Works for me, and I agree the patch implements that successfully.  "ALTER
EXTENSION x UPDATE;" is an infrequent command, and "ALTER EXTENSION x UPDATE
TO ..." is even less frequent.  It's not worth much special effort to shave
<TAB> steps.





view thread (8+ messages)  latest in thread

Message-ID: <20220703191122.GA2520965@rfd.leadboat.com>
Permalink:  ../20220703191122.GA2520965@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20220703191122.GA2520965@rfd.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, tgl@sss.pgh.pa.us, jeff.janes@gmail.com
  Subject: Re: 15beta1 tab completion of extension versions
  In-Reply-To: <20220703191122.GA2520965@rfd.leadboat.com>
  References: <CAMkU=1yV+egSYrzWvbDY8VZ6bKEMrKbzxr-HTuiHi+wDgSUMgA@mail.gmail.com> <1803867.1655596168@sss.pgh.pa.us> <1930937.1655614573@sss.pgh.pa.us> <20220703083217.GB2476530@rfd.leadboat.com> <1212507.1656858578@sss.pgh.pa.us> <1285253.1656871259@sss.pgh.pa.us> <20220703191122.GA2520965@rfd.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox