Re: adding tab completions
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Arthur Zakirov <a.zakirov@postgrespro.ru>,
Edmund Horner <ejrh00@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-09-21T19:29:14Z
Lists: pgsql-hackers
I wrote:
> The main thing that is bothering me about the remainder is its desire
> to offer single-punctuation-character completions such as "(". I do
> not see the point of that. You can't select a completion without
> typing at least one character, so what does it accomplish to offer
> those options, except clutter?
Actually, after poking at it for awhile, I noticed there was a much bigger
problem: tests like
else if (HeadMatches2("VACUUM", "("))
would continue to fire even if the option list was complete, so that
after typing say
vacuum ( verbose )
you would not get offered any table names, only option names.
I experimented with various fixes for that, but the only one that
worked required extending word_matches() to allow a wildcard in the
middle of a pattern. (Before it only allowed one at the end; but
it takes just a couple more lines of code to improve that.) With
that, we can do
else if (HeadMatches2("VACUUM", "(*") &&
!HeadMatches2("VACUUM", "(*)"))
and this test will not trigger if the option list is complete.
I've gone ahead and pushed it with those changes.
regards, tom lane
Commits
-
Improve tab completion for ANALYZE, EXPLAIN, and VACUUM.
- 121213d9d852 12.0 landed
-
Minor fixes for psql tab completion.
- 12368f5e83e7 11.0 landed
- 7046d3024605 12.0 landed
-
Add parenthesized options syntax for ANALYZE.
- 854dd8cff523 11.0 cited
-
Don't allow VACUUM VERBOSE ANALYZE VERBOSE.
- 921059bd66c7 11.0 cited
-
Parameter toast_tuple_target controls TOAST for new rows
- c2513365a0a8 11.0 cited
-
Add hash partitioning.
- 1aba8e651ac3 11.0 cited
-
Allow multiple tables to be specified in one VACUUM or ANALYZE command.
- 11d8d72c27a6 11.0 cited
-
Don't uselessly rewrite, truncate, VACUUM, or ANALYZE partitioned tables.
- 3c3bb99330aa 10.0 cited
-
Remove deprecated COMMENT ON RULE syntax
- e8d016d81940 10.0 cited
-
Add VACUUM (DISABLE_PAGE_SKIPPING) for emergencies.
- ede62e56fbe8 9.6.0 cited
-
Extend EXPLAIN to allow generic options to be specified.
- d4382c4ae7ea 9.0.0 cited