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.