postgresql/src
Tom Lane d854118c8d Teach psql's tab completion to consider the entire input string.
Up to now, the tab completion logic has only examined the last few words
of the current input line; "last few" being originally as few as four
words, but lately up to nine words.  Furthermore, it only looked at what
libreadline considers the current line of input, which made it rather
myopic if you split your command across lines.  This was tolerable,
sort of, so long as the match patterns were only designed to consider the
last few words of input; but with the recent addition of HeadMatches()
and Matches() matching rules, we really have to do better if we want
those to behave sanely.

Hence, change the code to break the entire line down into words, and to
include any previous lines in the command buffer along with the active
readline input buffer.

This will be a little bit slower than the previous coding, but some
measurements say that even a query of several thousand characters can be
parsed in a hundred or so microseconds on modern machines; so it's really
not going to be significant for interactive tab completion.  To reduce
the cost some, I arranged to avoid the per-word malloc calls that used
to occur: all the words are now kept in one malloc'd buffer.
2015-12-20 13:28:18 -05:00
..
backend Revert 9246af6799 because 2015-12-18 21:35:22 +03:00
bin Teach psql's tab completion to consider the entire input string. 2015-12-20 13:28:18 -05:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Revert 9246af6799 because 2015-12-18 21:35:22 +03:00
interfaces Fix out-of-memory error handling in ParameterDescription message processing. 2015-12-14 18:19:10 +02:00
makefiles Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
pl Instruct Coverity using an assertion. 2015-12-05 03:04:17 -05:00
port Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:31 -05:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Add missing COSTS OFF to EXPLAIN commands in rowsecurity.sql. 2015-12-19 16:55:14 -05:00
timezone Update time zone data files to tzdata release 2015g. 2015-10-02 19:15:39 -04:00
tools Use just one standalone-backend session for initdb's post-bootstrap steps. 2015-12-17 19:38:21 -05:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Make prove_installcheck remove the old log directory, if any. 2015-10-11 20:36:07 -04:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:26 -04:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00