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-11T20:35:51Z
Lists: pgsql-hackers
On Sat, Jun 09, 2018 at 06:42:12PM -0500, Justin Pryzby wrote:
> > Moreover there is no such completion for example for the command (it shows
> > only first column):
> >
> > CREATE INDEX ON test (
>
> Noted (I misunderstood at first: you just mean there's precedent that column
> names aren't completed, except maybe the first).
Yes, exactly. It was about the precedent.
> I can revise patch to not complete attributes in analyze; but, I think that
> means that this will have to complete to table names:
>
> postgres=# ANALYZE tt (a ,
> alu_enodeb_201601 information_schema.
> alu_enodeb_201602 jrn_pg_buffercache
> ...
>
> .. since, without checking for matching parens, it has no idea whether to
> complete with rels or atts. WDYT?
IMHO, I'd leave the code as simple as possible. It is up to you of
course. But it is easy to add completion for a first attribute, by
adding the condition (and leave other attributes without completion):
else if (HeadMatches1("VACUUM") && TailMatches1("("))
COMPLETE_WITH_ATTR(prev2_wd, "");
> > > - "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.
>
> Not in PG11(b1) (note, that's a custom table)
> postgres=# COMMENT ON RULE pg_settings_u IS 'asdf';
> ERROR: syntax error at or near "IS"
> ...
> Remove deprecated COMMENT ON RULE syntax
> e8d016d81940e75c126aa52971b7903b7301002e
Oh, I understood what it is it here. Those commit removed the syntax:
COMMENT ON RULE rule_name
But still there is the syntax:
COMMENT ON RULE rule_name ON table_name
I can run the command:
COMMENT ON RULE rtest ON test IS 'rtest';
> > The last point I've noticed, there is no VERBOSE entry after VACUUM FULL
> > ANALYZE command anymore.
>
> See commit 921059bd6, above (it's not 100% clear to me that's intended to
> reject VACUUM ANALYZE VERBOSE and not just reject VACUUM VERBOSE ANALYZE
> VERBOSE, but I tentatively assume it's intentional).
Right. Understood.
> > 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.
>
> I've done https://commitfest.postgresql.org/18/1661/
Thank you!
--
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