Re: adding tab completions

From: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Edmund Horner <ejrh00(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding tab completions
Date: 2018-06-05 14:29:42
Message-ID: 20180605142941.GA25460@zakirov.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-06-05 14:30:17 Re: plans for PostgreSQL 12
Previous Message Tom Lane 2018-06-05 14:20:55 Re: commitfest 2018-07