Re: adding tab completions

Artur Zakirov <a.zakirov@postgrespro.ru>

From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-05-29T09:27:27Z
Lists: pgsql-hackers
Hello,

On Mon, May 28, 2018 at 07:06:23PM -0500, Justin Pryzby wrote:
> Find attached tab completion for the following:

The patch works well. I have a couple notes.

The patch replaces the variable Query_for_list_of_tmf by
Query_for_list_of_tpmf. So I think Query_for_list_of_tmf isn't needed
anymore and can be removed.

I created partitioned table "measurement" and tried tab completion.

VACUUM (ANALYZE) measurement (<tab>

gives me only a comma. If I try to input table column:

VACUUM (ANALYZE) measurement (city_id<tab>

replaces "city_id" column by a comma: "VACUUM (ANALYZE) measurement (,".
The following with whitespace after column works well:

VACUUM (ANALYZE) measurement (city_id <tab>

and gives: "VACUUM (ANALYZE) measurement (city_id ,".

Also I think it could be good to list column names after parentheses,
but I'm not sure if it easy to implement.

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


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.