Re: adding tab completions

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Edmund Horner <ejrh00(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding tab completions
Date: 2018-06-03 23:18:59
Message-ID: 20180603231859.GV5164@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I finally got back to this; thanks everyone for reviews;

I also added completion for parenthesized explain (...)
d4382c4ae7ea1e272f4fee388aac8ff99421471a

and for ALTER TABLE SET (toast_tuple_target).
c2513365a0a85e77d3c21adb92fe12cfbe0d1897

BTW..should that be toast.tuple_target ??

Note that this also tries to comply with 921059bd66c7fb1230c705d3b1a65940800c4cbb
This is okay in v10 but rejected in v11b1:
postgres=# VACUUM ANALYZE VERBOSE t;
ERROR: syntax error at or near "VERBOSE"

On Tue, May 29, 2018 at 10:12:27AM -0400, Alvaro Herrera wrote:
> Is it just me that finds shocking the notion of vacuuming a foreign
> table?

Fixed, thanks.

On Tue, May 29, 2018 at 12:27:27PM +0300, Arthur Zakirov wrote:
> 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.

Fixed by adding relkind='p' to the existing list rather than making a new
query entry.

> 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.

The complication is that table names for which to pull the attributes isn't at a
constant offset; for example:
vacuum analyze a(TAB => needs prev2_wd
but
vacuum analyze a(c, TAB => needs prev3_wd

Maybe that's too much effort to include in tab completion. If so, the
"prev_parens" stanza can be removed from VACUUM and ANALYZE. If it's desired
to keep it, I guess I should avoid the duplicated lines.

On Wed, May 30, 2018 at 12:45:30AM +1200, Edmund Horner wrote:
> I don't believe it's meaningful to match on words with spaces in them,

Excellent point...fixed.

Find attached v6 (there were some "unpublished" versions).

Justin

Attachment Content-Type Size
v6-tab-complete-partitions text/plain 9.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guyren Howe 2018-06-03 23:35:04 Re: Code of Conduct plan
Previous Message Gavin Flower 2018-06-03 23:08:06 Re: Code of Conduct plan