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

  1. Improve tab completion for ANALYZE, EXPLAIN, and VACUUM.

  2. Minor fixes for psql tab completion.

  3. Add parenthesized options syntax for ANALYZE.

  4. Don't allow VACUUM VERBOSE ANALYZE VERBOSE.

  5. Parameter toast_tuple_target controls TOAST for new rows

  6. Add hash partitioning.

  7. Allow multiple tables to be specified in one VACUUM or ANALYZE command.

  8. Don't uselessly rewrite, truncate, VACUUM, or ANALYZE partitioned tables.

  9. Remove deprecated COMMENT ON RULE syntax

  10. Add VACUUM (DISABLE_PAGE_SKIPPING) for emergencies.

  11. Extend EXPLAIN to allow generic options to be specified.