Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

From: Tatsuro Yamada <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS
Date: 2018-12-20 01:05:30
Message-ID: 1c45ffd5-0a03-7608-43d8-a828253c0c52@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/12/19 18:22, Michael Paquier wrote:
> On Wed, Dec 19, 2018 at 04:26:27PM +0900, Tatsuro Yamada wrote:
>> Yep, I already did that for ALTER INDEX in tab_completion_alter_index_set_statistics.patch like this:
>>
>> + /* ALTER INDEX <name> ALTER COLUMN <colname> SET STATISTICS */
>> + else if (HeadMatches("ALTER", "INDEX") && TailMatches("SET", "STATISTICS")){
>> + /* We don't complete after "SET STATISTICS" */
>> + }
>
> [Wake up, Neo]

Welcome to the real world. :)

> Okay, then I propose to first extract a patch which does the following
> things as a first step to simplify the follow-up work:
> - No completion after "ALTER TABLE/INDEX SET STATISTICS" instead of
> schemas.
> - Complete "ALTER INDEX foo ALTER COLUMN SET" with STATISTICS (now this
> prints parameters, which is annoying).
>
> Then let's figure out the details for the rest.

Alright, I'll create new patches including these:

- No completion after "ALTER TABLE/INDEX SET STATISTICS" instead of schema names
- Complete "ALTER INDEX foo ALTER COLUMN SET" with STATISTICS by using *column_numbers*

After that,
I'll tackle to fix the documents for consistency, if possible.
====
https://www.postgresql.org/docs/current/sql-altertable.html

ALTER [ COLUMN ] column_name SET STATISTICS integer

https://www.postgresql.org/docs/current/sql-alterindex.html

ALTER [ COLUMN ] column_number SET STATISTICS integer
====

Thanks,
Tatsuro Yamada

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-12-20 01:38:31 Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS
Previous Message Tom Lane 2018-12-20 01:01:46 Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)