Further tweaks for psql's new tab-completion logic.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 9 Feb 2022 22:06:21 +0000 (17:06 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 9 Feb 2022 22:06:21 +0000 (17:06 -0500)
commitf0cd9097cfac435ec18ab2595c81f13a14736758
tree1ebac54696cadcecd55d8f2599a4ff5cf51867fe
parentc5f5b4dd4b5ccecd193550530ff483f16f95746b
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
src/bin/psql/t/010_tab_completion.pl
src/bin/psql/tab-complete.c