Re: adding tab completions
Artur Zakirov <a.zakirov@postgrespro.ru>
From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Edmund Horner <ejrh00@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-06-05T14:29:42Z
Lists: pgsql-hackers
On Sun, Jun 03, 2018 at 10:39:22PM -0500, Justin Pryzby wrote:
> Find attached an update which also supports column completion using the legacy
> non-parenthesized syntax.
Thank you!
> BTW..should that be toast.tuple_target ??
I think shouldn't. From the documentation "This parameter cannot be set for
TOAST tables".
> > Also I think it could be good to list column names after parentheses,
> > but I'm not sure if it easy to implement.
> I tried this and nearly gave up, but see attached.
After some thought now I think that this is not so good idea. The code
doesn't look good too. It doesn't worth it and sorry for the distraction.
Moreover there is no such completion for example for the command (it shows
only first column):
CREATE INDEX ON test (
> - "SERVER", "INDEX", "LANGUAGE", "POLICY", "PUBLICATION", "RULE",
> + "SERVER", "INDEX", "LANGUAGE", "POLICY", "PUBLICATION",
Is this a typo? I think still there is a possibility to comment rules.
> else if (HeadMatches1("EXPLAIN") && previous_words_count==2 && prev_wd[0]=='(' && ends_with(prev_wd, ')'))
I think this condition can be replaced by:
else if (TailMatches2("EXPLAIN", MatchAny) && ends_with(prev_wd, ')'))
It looks better to me. Such condition is used for other commands and
works the same way.
The last point I've noticed, there is no VERBOSE entry after VACUUM FULL
ANALYZE command anymore.
I'm not sure how this patch should be commited. Can it be commited
outside the commitfest? Otherwise add it to the next commitfest please
in order not to forget it.
Thoughts?
--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
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