Re: 15beta1 tab completion of extension versions

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: 15beta1 tab completion of extension versions
Date: 2022-07-03 08:32:17
Message-ID: 20220703083217.GB2476530@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2022-07-03 09:42:51 Re: Slow standby snapshot
Previous Message Noah Misch 2022-07-03 08:01:27 Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word