pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Further tweaks for psql's new tab-completion logic.
Date: Wed, 09 Feb 2022 22:06:36 +0000
Message-ID: <E1nHv6i-0007gk-7M@gemulon.postgresql.org> (raw)

Further tweaks for psql's new tab-completion logic.

The behavior I proposed, of matching case only when only keywords
are available to complete, turns out to be too cute.  It adds about
as many problems as it removes.  Simplify down to ilmari's original
proposal of just always matching case when completing a keyword.

Also, I noticed while testing this that we've pessimized the behavior
for qualified GUC names: the code is insisting that they be
double-quoted, which was not the case before.  Fix that by treating
GUC names as verbatim matches instead of possibly-schema-qualified
names.  (While it's tempting to try to split qualified GUC names
so that we *could* treat them with the schema-qualified-name code
path, that really isn't going to work in light of guc.c's willingness
to allow more than two name components.)

Dagfinn Ilmari Mannsåker and Tom Lane

Discussion: https://postgr.es/m/445692.1644018081@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f0cd9097cfac435ec18ab2595c81f13a14736758

Modified Files
--------------
src/bin/psql/t/010_tab_completion.pl | 24 ++++++++++----
src/bin/psql/tab-complete.c          | 63 ++++++++++++++++++++++--------------
2 files changed, 56 insertions(+), 31 deletions(-)



Message-ID: <E1nHv6i-0007gk-7M@gemulon.postgresql.org>
Permalink:  ../E1nHv6i-0007gk-7M@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nHv6i-0007gk-7M@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Further tweaks for psql's new tab-completion logic.
  In-Reply-To: <E1nHv6i-0007gk-7M@gemulon.postgresql.org>
  References: <E1nHv6i-0007gk-7M@gemulon.postgresql.org>

* 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