postgresql/src/bin/psql
Tom Lane bd1276a3c9 Prepare tab-complete.c for preprocessing.
Separate out psql_completion's giant else-if chain of *Matches
tests into a new function.  Add the infrastructure needed for
table-driven checking of the initial match of each completion
rule.  As-is, however, the code continues to operate as it did.
The new behavior applies only if SWITCH_CONVERSION_APPLIED
is #defined, which it is not here.  (The preprocessor added
in the next patch will add a #define for that.)

The first and last couple of bits of psql_completion are not
based on HeadMatches/TailMatches/Matches tests, so they stay
where they are; they won't become part of the switch.

This patch also fixes up a couple of if-conditions that didn't meet
the conditions enumerated in the comment for match_previous_words().
Those restrictions exist to simplify the preprocessor.

Discussion: https://postgr.es/m/2208466.1720729502@sss.pgh.pa.us
2024-10-07 12:19:12 -04:00
..
po Translation updates 2024-06-24 13:11:27 +02:00
t Remove test-case workarounds for ancient libedit versions. 2024-09-04 16:25:28 -04:00
.gitignore Add basic TAP tests for psql's tab-completion logic. 2020-01-02 15:02:21 -05:00
command.c psql: Clean up more aggressively state of \bind[_named], \parse and \close 2024-09-19 15:39:01 +09:00
command.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
common.c psql: Clean up more aggressively state of \bind[_named], \parse and \close 2024-09-19 15:39:01 +09:00
common.h psql: Clean up more aggressively state of \bind[_named], \parse and \close 2024-09-19 15:39:01 +09:00
copy.c Do not treat \. as an EOF marker in CSV mode for COPY IN. 2024-09-30 17:57:12 -04:00
copy.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
create_help.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
crosstabview.c Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
crosstabview.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
describe.c Fix psql describe commands' handling of ACL columns for old servers. 2024-09-24 17:21:38 -04:00
describe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
help.c psql: Add more meta-commands able to use the extended protocol 2024-08-22 16:25:57 +09:00
help.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
input.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
input.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
large_obj.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
large_obj.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
mainloop.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
mainloop.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls.mk More use of getpwuid_r() directly 2024-09-02 09:04:30 +02:00
prompt.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
prompt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
psqlrc.sample Improve FILES section of psql reference page. 2014-01-14 19:27:57 -05:00
psqlscanslash.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
psqlscanslash.l Allow noise semicolons ending psql \sf, \ef, \sv, \ev commands. 2024-01-10 14:20:09 -05:00
settings.h psql: Add more meta-commands able to use the extended protocol 2024-08-22 16:25:57 +09:00
startup.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
stringutils.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
stringutils.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tab-complete.c Prepare tab-complete.c for preprocessing. 2024-10-07 12:19:12 -04:00
tab-complete.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
variables.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
variables.h Update copyright for 2024 2024-01-03 20:49:05 -05:00