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-11 20:35:51
Message-ID: 20180611203547.GA18675@artur-book.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nico Williams 2018-06-11 20:52:46 Re: [PATCH v16] GSSAPI encryption support
Previous Message Tom Lane 2018-06-11 20:25:21 Re: automating perl compile time checking