pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Simplify tab completion of extension versions.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Simplify tab completion of extension versions.
@ 2022-06-21 16:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-06-21 16:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Simplify tab completion of extension versions.

Second thoughts about 9cd43f6cb: given that we're staying bug-compatible
with the old behavior of using double not single quotes for extension
versions, we can simplify this completion code by pretending that
extension versions *are* identifiers, and not using VERBATIM.  Then
_complete_from_query() will think that the query results are identifiers
in need of quoting, and we end up with the same behavior as before.

This doesn't work for Query_for_list_of_available_extension_versions_with_TO,
but let's just drop that: there is no other place where we handle
multi-keyword phrases that way, and it doesn't seem very desirable here
either.  Handle completion of "UPDATE TO" in our more usual pattern.

Discussion: https://postgr.es/m/CAMkU=1yV+egSYrzWvbDY8VZ6bKEMrKbzxr-HTuiHi+wDgSUMgA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/662dbe2c8657b01b436105754dff918a39a67365

Modified Files
--------------
src/bin/psql/tab-complete.c | 34 ++++++++++++----------------------
1 file changed, 12 insertions(+), 22 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Simplify tab completion of extension versions, redux.
@ 2022-07-03 19:27  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-07-03 19:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Simplify tab completion of extension versions, redux.

After commit 662dbe2c8, psql tab completion didn't conveniently
support the case of "ALTER EXTENSION foo UPDATE".  It'd always
add "TO", which is fine if you want to specify a target version
but not if you don't ... and surely the latter is the much more
common case.

To fix, remove "TO" from the initially offered completion; you now
need to press TAB one additional time to get that.  We won't try to
duplicate the old behavior of attempting initial completion on the
target version along with TO.  It's too squirrelly to get the quoting
right, and this is such an infrequent usage that it doesn't seem worth
expending a lot of effort and special code on.

Noted by Noah Misch.  Back-patch to v15.

Discussion: https://postgr.es/m/20220703083217.GB2476530@rfd.leadboat.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/22a67fdd5d2756860e0e0813e4a1ae11b69e21c7

Modified Files
--------------
src/bin/psql/tab-complete.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Simplify tab completion of extension versions, redux.
@ 2022-07-03 19:27  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-07-03 19:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Simplify tab completion of extension versions, redux.

After commit 662dbe2c8, psql tab completion didn't conveniently
support the case of "ALTER EXTENSION foo UPDATE".  It'd always
add "TO", which is fine if you want to specify a target version
but not if you don't ... and surely the latter is the much more
common case.

To fix, remove "TO" from the initially offered completion; you now
need to press TAB one additional time to get that.  We won't try to
duplicate the old behavior of attempting initial completion on the
target version along with TO.  It's too squirrelly to get the quoting
right, and this is such an infrequent usage that it doesn't seem worth
expending a lot of effort and special code on.

Noted by Noah Misch.  Back-patch to v15.

Discussion: https://postgr.es/m/20220703083217.GB2476530@rfd.leadboat.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/207fc033bd9f7d7f6f8a5609cf2c8caab5ce57f5

Modified Files
--------------
src/bin/psql/tab-complete.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-07-03 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 16:04 pgsql: Simplify tab completion of extension versions. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-03 19:27 pgsql: Simplify tab completion of extension versions, redux. Tom Lane <tgl@sss.pgh.pa.us>
2022-07-03 19:27 pgsql: Simplify tab completion of extension versions, redux. Tom Lane <tgl@sss.pgh.pa.us>

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