Re: 15beta1 tab completion of extension versions

Noah Misch <noah@leadboat.com>

From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-07-03T08:32:17Z
Lists: pgsql-hackers
On Sun, Jun 19, 2022 at 12:56:13AM -0400, Tom Lane wrote:
> Actually ... after further thought it seems like maybe we should
> make this more like other cases rather than less so.  ISTM that much
> of the issue here is somebody's decision that "TO version" should be
> offered as a completion of "UPDATE", which is unlike the way we do this
> anywhere else --- the usual thing is to offer "UPDATE TO" as a single
> completion.  So I'm thinking about the attached.

Which are the older completions that offer "UPDATE TO"?  I don't see any.

> This behaves a little differently from the old code.  In v14,
> 	alter extension pg_trgm upd<TAB>
> gives you
> 	alter extension pg_trgm update<space>
> and another <TAB> produces
> 	alter extension pg_trgm update TO "1.
> 
> With this,
> 	alter extension pg_trgm upd<TAB>
> gives you
> 	alter extension pg_trgm update to<space>
> and another <TAB> produces
> 	alter extension pg_trgm update to "1.
> 
> That seems more consistent with other cases, and it's the same
> number of <TAB> presses.

I think it makes sense to send UPDATE TO as a single completion in places
where no valid command can have the UPDATE without the TO.  CREATE RULE foo AS
ON UPDATE TO is a candidate, though CREATE RULE completion doesn't do that
today.  "ALTER EXTENSION hstore UPDATE;" is a valid command (updates to the
control file default version).  Hence, I think the v14 behavior was better.



Commits

  1. Simplify tab completion of extension versions, redux.

  2. Simplify tab completion of extension versions.

  3. Fix busted tab completion of extension versions.

  4. psql: improve tab-complete's handling of variant SQL names.